Home Forums SQL Server 2008 SQL Server 2008 - General How to copy the database from external server to my local system server through Stored Procedure RE: How to copy the database from external server to my local system server through Stored Procedure

  • kamasat (8/28/2012)


    Hi,

    I tried using the stored procedure to connect to the external server bu am unable to connect by entering the correct server name, user name and password. I don't have network. I think it is possible without network or through IP address.

    I tried to connect external server by using

    sp_addlinkedserver 'externalserver', 'SQL Server'

    and also I tried this

    sp_addlinkedsvrlogins 'externalserver', 'windowsusername', 'sa', 'sa'

    Select * From [externalserver].[mydatabase].[dbo].[mytable]

    But it is not connected. How to do it?

    How to connect to the external server to access to the external database to view the data and migrate the data into another identical database in my local system.

    Your valuable suggestion and sample stored procedure will be helpful. It is very urgent.

    Thanks

    Do you get an error message? What do you mean by " I don't have network."? Can you ping the other sql box? What does "But it is not connected." mean?

    Then I have to ask why do you need a link server for this? You stated you want to migrate the data from the server to your local? Can't you just import whatever data? That would be far easier than doing it through a link server.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/