Hi,
I would like to create a new table with an identity. I'm hoping to run this script unattended.
I would like the beginning counter to be the max(id) + 1 from a different table.
So far I have tried
But getting a syntax error.
Is there a way for me to do this?
Thanks!
I would like to create a new table with an identity. I'm hoping to run this script unattended.
I would like the beginning counter to be the max(id) + 1 from a different table.
So far I have tried
Code:
declare @maxirangeid int
set @maxirangeid = (select MAX(irangeid) + 1 from tempblockbase)
create table tempnewblock (irangeid int identity(@maxirangeid, 1), ilandid int, minint int)
But getting a syntax error.
Is there a way for me to do this?
Thanks!