November 24, 2008 at 7:29 am
I got to copy around 80 tables to a new database.
Is there a way just to turn off the constraints for one of the schemas.
In the database there will be SCHEMA 001, 002, - 006
So i be copying databasea schema 006 to databaseb schema 006
So i need to turn off constraints for databaseb schema 006.
Move all tables using DTS and then put back to constraints.
Rather than figuring out which ones are parents and childs.
Any idea would be appreciated.
November 24, 2008 at 8:11 am
DTS will script this, which should handle constraints. Or you can just do the scripting, move the structure of the tables and use DTS without the drop/create.
You said you are moving 006 to 006, is that a typo? Can't have two schemas the same in one database.
November 24, 2008 at 8:56 am
The datas is in databasea 006 - moving to databaseb 006
DTS didn't think it took care of the constraints.
November 24, 2008 at 9:01 am
I'm not clear on what you mean by parent and child constraints, unless you mean Primary Keys and Foreign Keys.
If that's the case, script the tables, including their keys, then script the data transfers in between the table creations and the key creations (move all the keys to the bottom of the script). Will that solve what you need?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 24, 2008 at 9:27 am
Sorry yes primary and foreign keys.
Ok so just do the insert and then select into this.
I thought there was a way to remove the constraint of primary to foreign and put it back.
November 24, 2008 at 10:15 am
I am going to try the DTS wizard and see if it works as there more than 80 tables ..
Cheers
November 24, 2008 at 12:55 pm
DTS worked just a treat - i thought it dropped indexes and such but seems ok .
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply