Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: Friday, August 22, 2014 3:06 PM
Points: 308, Visits: 583
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: Friday, August 29, 2014 10:25 AM
Points: 42, Visits: 1,051
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 @ 8:07 PM
Points: 12,910, Visits: 32,028
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1439902
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse