I am trying to implement the good ol’ SELECT @@IDENTITY like:
INSERT INTO NewsCategories (nCatName)
VALUES (@nCatName);
SELECT @@IDENTITY AS NewID;
But my SQL Server CE 4 is giving me the error:
There was an error parsing the query. [ Token line number = 4,Token
line offset = 1,Token in error = SELECT ]
Is this something to do with the limitations of SQL Server CE? If so are there any workarounds for this?
Sql Server Compact Edition doesn’t support batched queries, but you should be able to execute them one at a time and get what you’re after.