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?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • 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://www.sqlservercentral.com/Forums/Uploads/Images/b6ccada9-d70d-4a51-bdd8-421d.PNG

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

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

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