Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将整数分配给新创建的行:
INSERT INTO wcategory (name, description) values ('Manager','Hotel Managment'); INSERT INTO worker (name, categoryID) values ('User', CAL IDENTITY() );
但是,我似乎收到了意外的令牌 CALL 错误。知道如何正确调用最后一个身份吗?或者至少有解决办法吗?
使用 @@identity 或 scope_identity()。将它保存在一个变量中,然后在下一个插入语句中使用它。