linked server

May 15th, 2007 by Mr.M | No Comments »

If you are still using remote server for SQL, I suggest you make some progress and start moving over to linked server. Linked server is pretty easy to use/add.

sp_addlinkedserver 'server.f.q.d.n'

There are other parameters sp_addlinkedserver can take as well but the above should suffice. This will add an entry into the sys.servers table/view:

select name,data_source,is_linked,is_data_access_enabled from sys.servers where name like '%serverName%'

You should then see your server. Keep an eye on the is_linked and is_data_access_enabled column, it should be set to 1. If ’0′, you did something wrong.

Lastly, you should be able to run something like the following and get a result:

exec [server.f.q.d.n]...sp_who2
select * from [server.f.q.d.n].db.dbo.table1

Hopefully, you don’t get something like this:

Server 'server.f.q.d.n' is not configured for DATA ACCESS.

Leave a Reply

You must be logged in to post a comment.