Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Linked server Expand / Collapse
Author
Message
Posted Monday, April 8, 2013 8:23 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, August 2, 2016 1:56 PM
Points: 361, Visits: 721
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?
Post #1439865
Posted Monday, April 8, 2013 8:34 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, August 2, 2016 6:03 AM
Points: 44, Visits: 1,293
hi

You can use import/ export wizard to transfer the data if this is one off requirement.
Post #1439874
Posted Monday, April 8, 2013 9:21 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:16 PM
Points: 14,460, Visits: 37,994
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!
Post #1439902
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse