How can we Use Linked Server? Uses of Linked server



How can we Use Linked Server? Uses of Linked server..

Answer / samba shiva reddy . m

A linked server configuration enables SQL Server to execute commands against OLE DB data sources on remote servers.
Linked servers offer the following advantages:

Remote server access.
The ability to issue distributed queries, updates, commands, and transactions on heterogeneous data sources across the enterprise.
The ability to address diverse data sources similarly.
How to link another server in SQL Server 2005?
Go to Server Objects-->Linked servers
Right click on linked Servers it will give option to create new server give the remote server name
or
Basically – all I needed to do what set up a linked server by using the following system stored procedures:
sp_addlinkedserver '<Server Alias>', '', 'SQLNCLI', NULL, NULL, 'SERVER=<IP>', NULL
sp_addlinkedsrvlogin '<Server Alias>', 'false', NULL, '<username>', '<password>'

To remove the linked server once done then just call

sp_dropserver '<Server Alias>', 'droplogins';

example : u have another data base is running in different server(System) u need some tables,columns from that Server to write some query in that query u need that columns so u have to link with that server using above scenario then u can use those columns in your query.

for instance set up a linked server called myRemoteServer, then I would be able to access a table in the remote database using:
myRemoteServer.<DatabaseName>.dbo.<TableName>

It makes it relative much easier to map data between sources compared to having to backup/restore the remote source database to the target server.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What is a field name?

0 Answers  


how to avoid cursors? : Sql server database administration

0 Answers  


system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:28.513 if i write "select dateadd(dd,2,getdate()) ".it returns "2009-01-26 19:59:38.340"...my question is dat could it be possible to retrive da date in da format "26 jan 2009 ...."??

8 Answers  


What is the native system stored procedure to execute a command against all databases?

0 Answers  


State the difference between union and union all?

0 Answers  






Can we create clustered index on non primary key column

20 Answers   ABC, CTS,


Which tcl commands are available on the sql server?

0 Answers  


What is store procedure? How do they work? When do you use?

0 Answers  


What are cursors stored procedures and triggers?

0 Answers  


what is the difference detween pairwise comparison subquary and non pairwise comparison subquary?

2 Answers  


write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?

8 Answers  


What happens if you insert a duplicate key for the primary key column in ms sql server?

0 Answers  


Categories