INSERT into an identity column not allowed on table variables.

Normally, Inserting data explicitly in IDENTITY column in Table variable is not allowed.

Declare @Table1 Table(ID Int Identity(1,1), Column1 Varchar(10))
Insert @Table1(Id, Column1) Values(1,'Sql Server')
Go


It'll throws an error
Msg 1077, Level 16, State 1, Line 2
INSERT into an identity column not allowed on table variables.

No comments:

Post a Comment