how can I reset all identity seed in tables to the beginning numbers?
Tnx in advanced
Use this
DBCC CHECKIDENT (Tablename, RESEED, 30)
Markus
|||Use this
DBCC CHECKIDENT (Tablename, RESEED, 30)
Markus
|||Have a look at DBCC CHECKIDENT in SQL Books OnLine
"John" <john@.smith.com> wrote in message
news:doe4gc$n4j$1@.news2.netvision.net.il...
> I mad a clone of my db and delete all info that I don't need.
> how can I reset all identity seed in tables to the beginning numbers?
> Tnx in advanced
>
|||Use this
DBCC CHECKIDENT (tablename, RESEED,1)
|||this only work for one table
I want it all
Tnx
"MarkusB" <m.bohse@.quest-consultants.com> wrote in message
news:1135253936.827451.60600@.f14g2000cwb.googlegro ups.com...
> Use this
> DBCC CHECKIDENT (tablename, RESEED,1)
>
|||If your tables are not referenced by foreign keys you could give this a try
:-
TRUNCATE TABLE tablename
this will remove all data and reset the identity column to it's seed value.
To run this against every table in your database make use of exec
sp_MSforeachtable
"John" <john@.smith.com> wrote in message
news:doe5om$na6$1@.news2.netvision.net.il...
> this only work for one table
> I want it all
> Tnx
> "MarkusB" <m.bohse@.quest-consultants.com> wrote in message
> news:1135253936.827451.60600@.f14g2000cwb.googlegro ups.com...
>
No comments:
Post a Comment