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.
| Author |
Topic |
|
keithc1
Yak Posting Veteran
88 Posts |
Posted - 2004-06-28 : 23:28:53
|
| I created a table that has an identity field set up.I inserted a record and it was not the record i wanted associated with this particular identity seed. I deleted the record and inserted the record I wanted and now the identity value is 2 instead of 1. Is there anyway i can explicity state the record i want in there to an Identity value of 1?Keithc MCSE MCSA |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-06-28 : 23:36:54
|
| SET IDENTITY_INSERT wives ONINSERT wives(order, description)SELECT 1, 'She hates me'SET IDENTITY_INSERT wives OFFYou will also probably want to reseed it so the next number is 1.DBCC CHECKIDENT('wives',RESEED,1)This reseeds the table by the way.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
keithc1
Yak Posting Veteran
88 Posts |
Posted - 2004-06-28 : 23:57:09
|
| Thanks for the help, worked perfectlyKeithc MCSE MCSA |
 |
|
|
ravilobo
Master Smack Fu Yak Hacker
1184 Posts |
Posted - 2004-06-29 : 11:42:47
|
| Also truncating the table resets the identity columns------------------------I think, therefore I am |
 |
|
|
|
|
|