disable/enable indexes for table

  • Comments posted to this topic are about the item disable/enable indexes for table

    Wilfred
    The best things in life are the simple things

  • 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

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply