SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Linked server


Linked server

Author
Message
adonetok
adonetok
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1698 Visits: 819
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?
lazy writer
lazy writer
SSC-Enthusiastic
SSC-Enthusiastic (194 reputation)SSC-Enthusiastic (194 reputation)SSC-Enthusiastic (194 reputation)SSC-Enthusiastic (194 reputation)SSC-Enthusiastic (194 reputation)SSC-Enthusiastic (194 reputation)SSC-Enthusiastic (194 reputation)SSC-Enthusiastic (194 reputation)

Group: General Forum Members
Points: 194 Visits: 1293
hi

You can use import/ export wizard to transfer the data if this is one off requirement.
Lowell
Lowell
SSC Guru
SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)

Group: General Forum Members
Points: 73899 Visits: 40974
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!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search