September 29, 2006 at 7:12 am
I'm trying to copy over data from a table from serverA to serverB using SQL 2005 DTS. ServerB is using SQL 2000 which shouldn't matter, just a side note. I need to not only copy but also ensure the identity is also the same by doing an identity insert and reseed.
Here is the damn error that I know what it is but how to get around it in DTS!:
Error 0xc002f210: Preparation SQL Task: Executing the query "TRUNCATE TABLE [InstantForum414].[dbo].[InstantASP_Role
" failed with the following error: "Cannot truncate table 'InstantForum414.dbo.InstantASP_Roles' because it is being referenced by a FOREIGN KEY constraint.".
I understand the error, but how do I get around this without having to manually undo the constraint on the table? I am able to undo the constraints programically through SQL but cannot get my SQL to work via the SQL route in this wizard. I'd like to just use the
How the hell can I do a ALTER TABLE jdvqasql1.InstantForum414.dbo.InstantASP
and when I look at constraints in SQL 2005 for this table, the names are all abbreviated so how do I know the exact name of the constraint that's causing the issue unless I actually go to SQL to run this script below..which I cannot do unless I have a linked server in place which is something we cannot do at this moment?
DBCC CHECKIDENT ('qaservername.InstantForum414.dbo.Insta
SET IDENTITY_INSERT qaservername.InstantForum414.dbo.Instant
ALTER TABLE qaservername.InstantForum414.dbo.Instant
INSERT INTO qaservername.InstantForum414.dbo.Instant
SET IDENTITY_INSERT 'qaservername.InstantForum414.dbo.Instan
I tried pasting this using the SQL option in the wizard instead of letting DTS handle all this, either way, I cannot get my data moved over via DTS!
October 2, 2006 at 8:00 am
This was removed by the editor as SPAM
October 2, 2006 at 2:54 pm
why are u trying to do a truncate on a table that has references? How about delete (that is after deleting the data in the Child table) and then reload the table with identity insert?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply