0

I have a situation where I generate script of a database using SSMS and restore the schema and insert the data manually.

The problem Im facing now is with identity seed value.

Like,

Current Identity seed value 9 in main table and then I deleted id 8 and 9. Using SSMS generate a script and create a new database and import all the records. Now I can see that the Current Identity seed become 7 in new database table but I want it to be same as original table ie 9.

Is there any way to include the next identity seed value in the create table statement like MySQL has got.

Thank you Peter

Peter
  • 121
  • 7
  • if you need to worry about seed values, you've possibly designed it wrongly. But yes you can set the start seed value. – Mitch Wheat Apr 13 '20 at 09:01
  • There is some scenarios identity seeds important in our application. How can I set start seed value as you mentioned in script generation step? – Peter Apr 13 '20 at 09:15
  • also I dont think this is a duplicate question, Im asking a solution for doing while generating the table script not after the table creation, – Peter Apr 13 '20 at 09:18
  • "There is some scenarios identity seeds important in our application" - then I suggest your design might be incorrect. – Mitch Wheat Apr 15 '20 at 00:11

0 Answers0