Hi,@Claudinei Aparecido da Silva
Welcome to Microsoft T-SQL Q&A Forum!
I don't think your description is very clear. What you are doing is just to create a sequence and use the NEXT VALUE FOR function to generate the sequence number,
but when the sequence name is wrong, an error will naturally occur (the reason is that the sequence does not exist, so how do you generate the correct one? )
In the second step, the icStatus you made is just an alias, print the value of the correct serial number incremented by 1 each time, and get 1...2.3.4.---10000. Here you use select 1/0 to mean again what? Do you want to display each incremented serial number divided by a value?
Best regards,
Bert Zhou
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.