Monday, February 19, 2024

SQL Server How to Create a Linked Server

You can create a linked server by using following steps.

OPENROWSET function is another way to get data from different servers. In SQL Server this function takes different parameters to get data from another server. 

  1. Provider name
  2. Data source i.e. Server name
  3. Username and Password
  4. Query

OPENROWSET functions should be used if you have not created linked server. For a particular data source this function will allow you to connect to a data source directly using OLEDB. 

OPENDATASOURCE function is another way to get result set from data source.  This function takes

  1. Provided name
  2. Connection string

It is more flexible than open row set. In the connection string provider, data source, user ID and password are separated by semi-colon.

No comments:

Post a Comment

Hot Topics