![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all. I am trying to use as DTS package to import data across from an old SQL 6.5 database to a new 2000 one. I have already used the upgrade wizard to set-up all the tables and fixed the few minor problems that occurred. I just want to import the data and overwrite the data that is present already. The problem I have is that the DTS does not seem to transfer the data in a sensible order. It does not seem to consider foreign key relatshionships. What happens is that the package tries to import child records into a table before the parent records have been created in the master table. This then complains about the foreign key being violated and cancels the import for the table concerned. So I end up with about a third of the tables being transferred successfully and I then have to re-run the import on the remaining tables. I need to be able to do this several times over the next few weeks, so I want to figure out how to get the package to work. Is there some way to disable all the foreign keys whilst the import is running and then re-enable them again? Thanks. John. |
#3
| |||
| |||
|
|
OK The way I would do it is this. If you have the same constraints on your tables in 6.5 as those in 2000 then you know the data is clean (As far as RI is concerned). I would script out DROP statements for the constraints or ALTER TABLE <name> NOCHECK CONSTRAINT ALL Pump the data then reapply the check constraints. To actually check the data then you issue a dummy update to the table -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "John Faris" <johnfaris (AT) nospam (DOT) hotmail.com> wrote in message news:uzx0ZckvDHA.2072 (AT) TK2MSFTNGP10 (DOT) phx.gbl... Hi all. I am trying to use as DTS package to import data across from an old SQL 6.5 database to a new 2000 one. I have already used the upgrade wizard to set-up all the tables and fixed the few minor problems that occurred. I just want to import the data and overwrite the data that is present already. The problem I have is that the DTS does not seem to transfer the data in a sensible order. It does not seem to consider foreign key relatshionships. What happens is that the package tries to import child records into a table before the parent records have been created in the master table. This then complains about the foreign key being violated and cancels the import for the table concerned. So I end up with about a third of the tables being transferred successfully and I then have to re-run the import on the remaining tables. I need to be able to do this several times over the next few weeks, so I want to figure out how to get the package to work. Is there some way to disable all the foreign keys whilst the import is running and then re-enable them again? Thanks. John. |
![]() |
| Thread Tools | |
| Display Modes | |
| |