April 8, 2013 at 8:23 am
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?
April 8, 2013 at 8:34 am
hi
You can use import/ export wizard to transfer the data if this is one off requirement.
April 8, 2013 at 9:21 am
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply