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 |
|
SQLCode
Posting Yak Master
143 Posts |
Posted - 2004-02-18 : 10:52:14
|
| Hi,Is there any quick way of disabling all the constraints and triggers of the database for a quick append of data, assuming the data is good with all the integrity.TIA |
|
|
safigi
Starting Member
15 Posts |
Posted - 2004-02-18 : 11:12:31
|
| exec sp_msforeachtable 'alter table ? nocheck constraint all 'exec sp_msforeachtable 'alter table ? disable trigger all 'Safi |
 |
|
|
SQLCode
Posting Yak Master
143 Posts |
Posted - 2004-02-18 : 11:23:25
|
| Ahaa! Thanks a lot. Also, I found out that while enabling them back we can also print the name of the object.Here goes :sp_msforeachtable @command1="print '?'", @command2="ALTER TABLE ? CHECK CONSTRAINT all"sp_msforeachtable @command1="print '?'", @command2="ALTER TABLE ? ENABLE TRIGGER all" |
 |
|
|
|
|
|