Linked server

  • I created a linked server and use it to select data from one server to another.

    Is there another way except for linked server which will do the same job?

  • hi

    You can use import/ export wizard to transfer the data if this is one off requirement.

  • adonetok (4/8/2013)


    I created a linked server and use it to select data from one server to another.

    Is there another way except for linked server which will do the same job?

    OPENROWSET lets you define the connection properties, but you need to have access/permissi0ons, whether via trusted connection or with a username and password;

    you also have to create a static string, openrowset does not access parameters, only static strings...

    so if in this contrived example i needed records for ORGID = 811 and also 812, i'd have to do everything with dynamic SQL or modify this static string of the parameters.

    --database name required

    SELECT *

    FROM OPENROWSET( 'SQLNCLI',

    'Server=OTHERSERVER\SQL2005;Trusted_Connection=yes;',

    'SET FMTONLY OFF; SET NOCOUNT ON; SELECT ColumnList FROM Db_Name.dbo.GetCategoriesByDocIDAsTable WHERE ORGID = 811'

    )

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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