I have a temp table with in a SP.
CREATE TABLE #bclist (
bcastid INT
,userid INT
,etype INT
,articles0 BIGINT
,seq INT identity(1, 1)
)
I also have a variable @nextseq
What I want is somthingh like below
CREATE TABLE #bclist (
bcastid INT
,userid INT
,etype INT
,articles0 BIGINT
,seq INT identity(@nextseq, 1)
)
But SQl server doesn’t permit this .Any solution ?
You can use
But it will not work if your SP is not running from dbowner.
Another thingh you can do is to reseed the table.
Don’t forget the if condition otherwise in you seq coulmn you will get values from 2 instead of 1.