Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Script for all FK Constraints in a Database?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01537261
Message ID:
01537307
Vues:
23
>>The blog link I gave you does 'ALTER TABLE' script to drop / add constraints.
>>
>>Alternatively, you should be able to do it with the PowerShell script. You may want to google on 'PowerShell foreign constraints script'
>
>I found this page (url below) that shows how to create all FK constraints. I just tested it on a test database and it work well. This is a keeper. I looked at the reference to PowerShell but don't understand it. Even though most people comment that it is easier to use than scripting in SQL Server. Something for me to read at another date.
>
>http://social.technet.microsoft.com/wiki/contents/articles/2958.script-to-create-all-foreign-keys-en-us.aspx

Both PowerShell scripts are really great. I ran them and got the scripts.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform