Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

disable/enable indexes for table Expand / Collapse
Author
Message
Posted Thursday, August 14, 2008 3:59 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, August 14, 2014 8:25 AM
Points: 929, Visits: 1,127
Comments posted to this topic are about the item disable/enable indexes for table

Wilfred
The best things in life are the simple things
Post #552523
Posted Thursday, October 16, 2008 7:25 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, May 21, 2012 3:13 PM
Points: 516, Visits: 1,563
Perhaps a correlary script to disable contraints and triggers when copying large amounts of data from one database to another is
sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
go
sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER all"
go
sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"
go
sp_msforeachtable "ALTER TABLE ? ENABLE TRIGGER all"
go

Steve



Post #586949
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse