I'm trying to set IDENTITY seed parameter while creating table, getting it from a var. Something like this
DECLARE @MaxID INTEGER
SET @MaxID = (SELECT TOP 1 ID FROM dbo.ProductQuotes ORDER BY ID DESC) + 1;
CREATE TABLE [dbo].[Z](
[ID] int PRIMARY KEY not null IDENTITY(@MaxID,1),
[Number] int NULL,
[Name] nvarchar(50) COLLATE Cyrillic_General_CI_AS NULL
) ON [PRIMARY]
GO
Error is "incorrect syntax near '@MaxID' (in this row [ID] int PRIMARY KEY not null IDENTITY(@MaxID,1) )
But I'm not sure it's about syntax at all. Can somebody explain me where am I wrong here? :)
IDENTITY
)