Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 auto-generated key

Author  Topic 

mathmax
Yak Posting Veteran

95 Posts

Posted - 2007-02-07 : 10:43:53
Hello,

I've a problem with auto-generated key. In my parent table, some lines have been deleted. I would like to add new lines with the same content in order to restore my database, but I cannot decide on the id value which is an auto-generated key. Is there a solution to set an auto-generated key with a specific value ?

Thank you in advance,

regards,

mathmax

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-07 : 10:46:29
SET IDENTITY_INSERT Table1 ON


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

mathmax
Yak Posting Veteran

95 Posts

Posted - 2007-02-07 : 12:14:21
sorry, I'm a beginner. Where should I put this code ?
Go to Top of Page

Tks
Starting Member

48 Posts

Posted - 2007-02-07 : 12:55:46
just send it off like in a normal query

before you do the insert query with the correct id´s you want to apply.

then offcourse shut it down again.. after

Tks
Go to Top of Page
   

- Advertisement -