Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mavericky
Posting Yak Master
117 Posts |
Posted - 2012-02-16 : 13:34:20
|
| Hi,Can anyone tell me if there is any way to :1.> create a script to drop all the Foreign Key constraints from a database2.> create a script to create all the Foreign Key constraints on a databaseThanks in anticipation,Mavericky |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-02-16 : 15:39:34
|
quote: Originally posted by mavericky Hi,Can anyone tell me if there is any way to :1.> create a script to drop all the Foreign Key constraints from a database2.> create a script to create all the Foreign Key constraints on a databaseThanks in anticipation,Mavericky
you can make use of INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS or sys.foreign_keys and sys.foreign_key_columns for that------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|