General information
Forum:
Microsoft SQL Server
Title:
Table With Identity PK
Hi,
I have a table with an Identity Primary Key.
I want to insert some records without using the identity.
So, I tried that and I got an error:
CREATE TABLE dbo.tblOperations (
IdOperation int IDENTITY (1, 1) NOT NULL ,
NoSite int NOT NULL ,
blabla...
SET IDENTITY_INSERT dbo.tblOperations ON
insert dbo.tblOperations
select IdOperation,
3
from #tblOperations
and I GOT THIS ERROR:
Server: Msg 8101, Level 16, State 1, Line 1
An explicit value for the identity column in table 'dbo.tblOperations' can only be specified when a column list is used and IDENTITY_INSERT is ON.
Thank in advance,
Dave
Technologies Nter
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only