This is the code:
declare @Ids table ( Id int identity(1,1));
SET IDENTITY_INSERT @Ids ON;
and I get:
Incorrect syntax near '@Ids'
I cannot see what's wrong. Any ideas? Thanks.
See Question&Answers more detail:osThis is the code:
declare @Ids table ( Id int identity(1,1));
SET IDENTITY_INSERT @Ids ON;
and I get:
Incorrect syntax near '@Ids'
I cannot see what's wrong. Any ideas? Thanks.
See Question&Answers more detail:osYou can't use SET IDENTITY_INSERT on table variables
This works
CREATE TABLE Ids ( Id int identity(1,1))
SET IDENTITY_INSERT Ids ON
and this
CREATE TABLE #Ids ( Id int identity(1,1))
SET IDENTITY_INSERT #Ids ON