Link to home
Start Free TrialLog in
Avatar of Easwaran Paramasivam
Easwaran ParamasivamFlag for India

asked on

In which order I should drop the constraints and recreate them?

I've a database in which I would like to do bulk schema changes. The DB does not have FK.  I would like to delete following constraints and recreate them later point. In which order I could drop the constraints and in which order I could recreate them?

PK, Default, Unique, NOT NULL, and CHECK, Clustured index, Non clustured index, Triggers

Please assist. Thanks
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Easwaran Paramasivam

ASKER

Actually speaking I get constraints from one database and run in another database (after dropping all constraints) in order to sync the two database in all respect. Please provide solution.
Hi,

If you need to sync the db schema of two dbs you may check on some of third party tools available on the web. I have used DBGhost in the past and found it very helpful. You may define a source and a target db, and it will check for any schema differences. Then it will prompt for auto creating scripts to sync the target db.

Giannis
@lcohan: Does below order correct?

Dropping order is null, check, unique, default, non clustered index, clustered index, PKeys.

Add them back - Clustered index, PK,  Non clustered Index, default, unique, check, Null