romeiovasu
asked on
SQL 2005 connectiion link
i am using sql server 2005. i have another database which is on the other network. and i have odbc connection settings if i want to link to that database in my sql how can i link that database and start writing queries.
ASKER
i am getting this error The OLE DB provider "MSDASQL" has not been registered.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
on svr1
sp_addlinkedserver 'svr2'
then to run a query
select top 10 * from svr2.database.dbo.tablenam
you can even join to local tables, like
select top 10 * from svr2.database.dbo.tablenam
check books online for sp_addlinkedserver. the example above will use the current login (to svr1) to authenticate with svr2. so if you're on a domain and using windows authentication, shouldn't be a problem