SQL Server Export Wizard Problem with constraints

  • TITLE: SQL Server Import and Export Wizard
    ------------------------------

    Error 0xc002f210: Preparation SQL Task 1: Executing the query "TRUNCATE TABLE [dbo].[Counties]
    " failed with the following error: "Cannot truncate table 'dbo.Counties' because it is being referenced by a FOREIGN KEY constraint.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

  • polo.csit - Wednesday, February 15, 2017 5:05 AM

    TITLE: SQL Server Import and Export Wizard
    ------------------------------

    Error 0xc002f210: Preparation SQL Task 1: Executing the query "TRUNCATE TABLE [dbo].[Counties]
    " failed with the following error: "Cannot truncate table 'dbo.Counties' because it is being referenced by a FOREIGN KEY constraint.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

    Error message appears self-explanatory, so what is your question?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I could be wrong but I'm guessing the question is

    how do I fix it?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle - Wednesday, February 15, 2017 6:20 AM

    I could be wrong but I'm guessing the question ishow do I fix it?

    There are a number of answers to this, which is why I was hoping for something more specific from the OP. But here's one for starters:
    Select 'Append rows to destination table' rather than 'Delete rows in destination table' when configuring column mappings.

    https://qa.sqlservercentral.com/Forums/Uploads/Images/b6ccada9-d70d-4a51-bdd8-421d.PNG

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply