none
how to insert data from one server to another server? RRS feed

  • Question

  • Dear frnds


    i have written the script in server ABC and the database XYZ, so i want to insert the data into the second server Customserver

    hw should i insert the data .

    Iam already tried for this creating the Linked server and exueting the script and inserting the data into that table but it will working on the current query editor only  but

    it should not been updated on the Target server database table.

    below is the script pls help me out for this...

    ------------------------------------------------------------------------------------------------
    -- Creating the Linked server instance
    --------------------------------------------------------------------------------------------------
    sp_addlinkedserver 'sp_helpserver','','SQLNCLI',Null,Null,'Server=ABC001',Null
    exec SP_addlinkedsrvlogin 'sp_helpserver','false',Null,'nshy22','#abx123'

    ---------------------------------------------------------------------------------------------------
    --Insert  data into the do.children
    ---------------------------------------------------------------------------------------------------
    Truncate table dbo.children

    Insert into dbo.Site_Table
    select distinct Name, Code,State,
     from dbo.children
    ------------------------------------------------------------------------------------------

        
    ------------------------------------------------------------------------------------
    --Insert data into the master
    -------------------------------------------------------------------------------------
    Truncate table Master

    insert  into Master  
    Select Code,Name,country from dbo.master

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

    • Edited by Ychinnari Monday, September 29, 2014 3:30 PM
    Monday, September 29, 2014 1:30 PM

Answers

All replies