Forum Discussion
Using a Sequence
There are more limitations than the message mentioned, This article descripted https://learn.microsoft.com/en-us/sql/t-sql/functions/next-value-for-transact-sql?view=sql-server-ver16#limitations-and-restrictions
Since we can't see the context that you called sp, guess there might be having SET ROWCOUNT ON or something else.
rodgerkongI think my OP was a bit misleading where I mentioned "Stored Procedure" I get the noted error message when I try to CREATE it. That is, when I run the procedure in the last code block.
I did try setting ROWCOUNT = 0 but that didn't change the result.
I've looked at the useful link you provided but I still can't identify what may be causing the error since I'm trying to create a stored procedure, not trying to run one. But I'll go over the possible causes again to see if something looks relevant.