How can we Use Linked Server? Uses of Linked server
Answer Posted / 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 View All Answers
What are the different types of collation sensitivity in sql server?
Write a sql query to get zero records from a table having n number of records?
What is difference between temp table and cte?
What is sub query and its properties?
What is acid db?
Explain features and concepts of analysis services?
Why does sql studio use a single registered database repository? : sql server management studio
Do you know what is blocking?
Which are ddl commands?
What is the advantage of sql server?
What is onf in normalization form?
what is the information that can be stored inside a bit column? : Sql server database administration
What do you understand by a view? What does the with check option clause for a view do?
Explain nested join?
What is the difference between a fill factor of 100 and 0?