I’m trying to assign integer to a newly created row:
INSERT INTO wcategory (name, description) values ('Manager','Hotel Managment');
INSERT INTO worker (name, categoryID) values ('User', CAL IDENTITY() );
However I seem to be getting unexpected token CALL error.
Any idea how to call last identity correctly? or at least is there a work aroud?
Use @@identity or scope_identity(). Save it in a variable and then use it in the next insert statement.