Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving from test to production - identify seed question
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Divers
Thread ID:
00659937
Message ID:
00660042
Vues:
12
I think that you can start by truncating child tables. This way, you should not have problems with foreign keys.


>Hi Eric,
>
>Thanks for the info. I can't use Truncate table on a table referenced by a foreign key constraint.
>
>I'll have to figure out a way to delete the constraints - before truncating the tables - and then rebuild them once all appropriate tables have been truncated.
>
>Al
>
>>instead of deleting rows, you can truncate them (which delete ALL rows and reset identity columns).
>>
>>truncate table YourTableName
>>
>>
>>>Hi,
>>>
>>>We will soon be ready to move a VB-SQL 2000 app from testing to production. We will be deleting records from most of the tables (excluding some settings tables) accumulated during testing. Creating a SQL script to do this is simple enough.
>>>
>>>My question is this: I would like to reset the identity seed for these tables after deleting the records. How should I do this? Can it be done as part of my script?
>>>
>>>Thanks in advance.
>>>
>>>Al
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform