I want to check that the srv_datasource value of a liked server is still
pointing at the correct location.
I can run the stored proc
sp_linkedservers
and see that the value is correct...but how can I do that programmatically?
I mean how do I actually code to look at the value of srv_datasource for a
given value of srv_name returned by the sp_linkedservers stored proc?
Al Blake, Canberra, AustraliaThe datasource & provider string are retrieved from master..sysservers
table. You can either query it directly like:
SELECT *
FROM master.dbo.sysservers
WHERE srvname = @.server ;
or you can get the resultset of sp_linkedservers into a #temp table & query
from the table.
Anithsql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment