Export wizard failed?

  • Hi,

    pl. suggestion me, what could be on issues during export to another new database by export wizard? how to resolve it?

    - Copying to [dbo].[BC_ConfigInstance] (Error)

    Messages

    Information 0x402090e0: Data Flow Task 2: The final commit for the data insertion in "component "Destination 9 - BC_ContainerAttribute" (358)" has ended.

    (SQL Server Import and Export Wizard)

    Error 0xc0202009: Data Flow Task 2: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.

    An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80004005 Description: "The statement has been terminated.".

    An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80004005 Description: "The INSERT statement conflicted with the FOREIGN KEY constraint "FK_BC_Container_BC_Owner". The conflict occurred in database "BaseComponents", table "dbo.BC_Owner", column 'OwnerID'.".

    (SQL Server Import and Export Wizard)

    rgds

    ananda

  • The table you are trying to insert data into has a Foreign Key Constraint. Which means that it is referencing another table for values in the Foreign Key column. It can only have values which are present in the table it is referencing.

    In short, you are trying to insert an external value into the table which is not present in the table that it references.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] πŸ˜‰

  • Source database - data is available for all tables...

    Generate Script source database and create newdatabase with another name and all other structure and PK, FK ,Identity every thing same as existing source database.

    During export to new database base through export wizard -

    One error was resolved(meta data validation) -> enable Identity insert,

    Second error - above one(which is posted first), For the resolve this issues need to disable FK on table?

  • ananda.murugesan (12/31/2012)


    Source database - data is available for all tables...

    Generate Script source database and create newdatabase with another name and all other structure and PK, FK ,Identity every thing same as existing source database.

    During export to new database base through export wizard -

    One error was resolved(meta data validation) -> enable Identity insert,

    Second error - above one(which is posted first), For the resolve this issues need to disable FK on table?

    Yes you can Drop the FK constraint an do it. But, since the table had an FK, I am assuming that there was some parent child relationship between the PK Table and the FK Table. Since some foreign data would be inserted into the FK Table which is not present in the PK Table, if you drop the FK Constraint, then you might not be able to recreate the FK Constraint.

    Instead of dropping the constraint and inserting the data I would rather find out the items that are causing the error on insertion.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] πŸ˜‰

  • After exporting data into all tables then we can not recreate FK relationship to the table.

    Instead drop and recreate FKs, I did disable all the constraints then export data to all the tables. Afte that enable all constraints and checking everything ok.

  • All the tables.....do you mean including the parent table which is being referenced by the Child Table??.....If that is so then the Foreign Key Constraint can be created as the new data in both tables would be in sync.........

    Good that you got it working πŸ™‚

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] πŸ˜‰

  • Pl. Let me know, In export wizard FK, PK and constraints does not come to destinaton database..Is it correct?

  • Yes it is correct.....if the Destination Table is created by the Import/Export Wizard....

    Is it still not working??.....I thought you had got it working.....Please post the detailed Error message.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] πŸ˜‰

  • you may decide to check this link that allows you to disable the constraints on loading and also enable them after loading

    EXEC sp_MSforeachtable @command1="ALTER TABLE ? NOCHECK CONSTRAINT ALL"

    This will disable all constraints on all tables. Once the data has been loaded constraints can be re-enabled with the following :

    EXEC sp_MSforeachtable @command1="ALTER TABLE ? WITH CHECK CHECK CONSTRAINT ALL"

    The β€˜WITH CHECK’ option specifies that the data is validated against the constraint.

    Find more here . . .

    http://www.sqlmatters.com/Articles/Common%20Issues%20with%20the%20SQL%20Server%20Import%20and%20Export%20Wizard.aspx

Viewing 9 posts - 1 through 8 (of 8 total)

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