Import data into identical tables on different database

  • I'm a SSIS and SQL Server noobie so please be gentle.

    I need to copy the data from some tables in one database to identical tables (except for the identity primary key column) in another database.

    The package won't know the actual tables until runtime.

    What methods do you recommend?

    Cheers

    Bec

  • I would suggest passing the database connection string and table name in through an environment configuration variable.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Sorry but my issue is what task to use to copy the data from one database to the other. I can't use bulk insert because that only works with files as the source. Data flows won't do either since the column mappings cannot be dynamic.

  • Oh, you don't know the table structure or column names ahead of time either? Well, that's a pretty significant detail.

    Hmm, you might try the Transfer SQL Server Objects task, but it's hard to say if this will really fit your needs. You may have to resort to script or code.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

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

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