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:
00660497
Vues:
7
>Can you temporarily drop with contraint with
>
>ALTER TABLE Tablename NOCHECK CONSTRAINT ConstraintName
>
>then reestablish with
>
>ALTER TABLE Tablename CHECK CONSTRAINT ConstraintName

I ended-up dropping all constraints, then re-establishing them:



Print 'Disabling all Constraints'
GO
sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT ALL"
GO

-- code to delete records

Print 'Enabling all Constraints'
GO
sp_msforeachtable "ALTER TABLE ? CHECK CONSTRAINT ALL"
GO
Al Williams

Anola MB, CANADA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform