back up and restore rows in sql server 2008

  • I want to back up some rows of table from sql

    then restore rows to another database. I have two table with relation

  • This sounds like a job best suited for SSIS rather than a backup / restore

  • sfr_rezaei (11/8/2010)


    I want to back up some rows of table from sql

    then restore rows to another database. I have two table with relation

    How about using Linked server (if it is required as a permanaent) or opendata source if it is one time

    if the table already exists then:

    insert into databasename.dbo.tablename

    select * from linkedserver.dbname.dbo.tablename

    insert into databasename.dbo.tablename

    select * from opendatasource ('SQLOLEDB','Data Source=<ip,portno>; User ID=<username>;Password=<password>').dbname.dbo.tablename

    Ofcourse SSIS is also another way of doing it.

    HTH,

    Cheers

    ______________________________________________________________________________________________________________________________________________________________________________________
    HTH !
    Kin
    MCTS : 2005, 2008
    Active SQL Server Community Contributor 🙂

  • sfr_rezaei (11/8/2010)


    I want to back up some rows of table from sql

    then restore rows to another database. I have two table with relation

    How about using Linked server (if it is required as a permanaent) or opendata source if it is one time

    if the table already exists then:

    insert into databasename.dbo.tablename

    select * from linkedserver.dbname.dbo.tablename

    insert into databasename.dbo.tablename

    select * from opendatasource ('SQLOLEDB','Data Source=<ip,portno>; User ID=<username>;Password=<password>').dbname.dbo.tablename

    Ofcourse SSIS is also another way of doing it.

    HTH,

    Cheers

    ______________________________________________________________________________________________________________________________________________________________________________________
    HTH !
    Kin
    MCTS : 2005, 2008
    Active SQL Server Community Contributor 🙂

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

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