Avatar of csePixelated
csePixelated
Flag for United States of America asked on

INSERT INTO while IDENTITY_INSERT is set to OFF

I have the following - however when i try to run it i get "Cannot insert explicit value for identity column in table 'DAAutoReportsLimit' when IDENTITY_INSERT is set to OFF."
INSERT INTO DAAutoReportsLimit(ID, ID_AutoReport, Limit)
SELECT
  350163, ID_AutoReport, Limit
FROM
  DAAutoReportsLimit
WHERE
  ID = 349730

Open in new window

can i simply set IDENTITY_INSERT is set to ON- while my database is in use then turn it of once i have added my rows?
DatabasesMicrosoft SQL ServerSQL

Avatar of undefined
Last Comment
ste5an

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ste5an

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23