Question : Disabling constraint check

Hi Experts,
I'm trying to change the collation of many fields in the database.  I'm using Alter table...collate
I have generated a long script to change all the fields of type char and varchar in all the tables, there are thousands of fields.
When I start the script I get this error

The index abc is dependent on column xyz
failed because one or more objects access this column

When I change the collation via Enterprise manager on the same field or column I dont get an error message and the change is successful.
I cannot drop the constraint on each column via script, coz as I said earlier I have thousands of fields.
Is there a way to stop SQL server constraint check

Thanks for any feedback,
-Gus

Answer : Disabling constraint check

There is no way to disable the constraint.  You need to drop it then re-create it.

If you want the code to drop and recreate all your scripts.

You do not need to code it as enterprise manager does it for you.

Right click on the database and select Generate SQL Script.  Select all tables and the options to generate drop and generate constraints.

It will generate all the script to drop all the constrints tables and recreate them.  Trim out all the table drop and create code and insert you alter table script.

Cheers Sash
Random Solutions  
 
programming4us programming4us