Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Script for all FK Constraints in a Database?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01537261
Message ID:
01537307
Views:
22
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform