Syntax of OPENDATASOURCE Function :
OPENDATASOURCE ( provider_name, init_string )
provider_name is a name registered as the PROGID of the OLE DB provider used to access the data source. provider_name is a char data type, with no default value.
init_string is a connection string passed to the IDataInitialize interface of the destination provider. The provider string syntax is based on keyword-value pairs separated by semicolons, that is, "keyword1=value; keyword2=value."
Examples of OPENDATASOURCE Function :
Example 1 : Use of OPENDATASOURCE function in select clause
SELECT ContactName, CompanyName, ContactTitle
FROM OPENDATASOURCE('SQLOLEDB',
'Data Source=ServerName;User ID=MyUID;Password=MyPass' ).Northwind.dbo.Customers
Above example accesses data from a Customers table on another instance of SQL Server.