July 27, 2009 at 1:15 pm
I have a set of related dbs and I need to do some cross-db queries and I want to do them generically. If I can query for the linked servers and get enough info to build the 4-part names, it'll be better than creating table to hold dsn's separately.
With all the DMVs in 2008, they gotta have this by now.
tks much.
July 27, 2009 at 1:56 pm
Yes. You can use sp_linkedservers to return a list of all linked servers on an instance.
More information...http://msdn.microsoft.com/en-us/library/ms189519(SQL.90).aspx
December 28, 2016 at 2:28 pm
select * from sys.servers where is_linked = 1
December 28, 2016 at 4:20 pm
kevinH-1006814 (7/27/2009)
I have a set of related dbs and I need to do some cross-db queries and I want to do them generically. If I can query for the linked servers and get enough info to build the 4-part names, it'll be better than creating table to hold dsn's separately.With all the DMVs in 2008, they gotta have this by now.
tks much.
Why are you using LinkedServers for mere cross-db queries? Are they on different instances?
--Jeff Moden
Change is inevitable... Change for the better is not.
March 7, 2018 at 3:47 pm
Jeff Moden - Wednesday, December 28, 2016 4:20 PMkevinH-1006814 (7/27/2009)
I have a set of related dbs and I need to do some cross-db queries and I want to do them generically. If I can query for the linked servers and get enough info to build the 4-part names, it'll be better than creating table to hold dsn's separately.With all the DMVs in 2008, they gotta have this by now.tks much.Why are you using LinkedServers for mere cross-db queries? Are they on different instances?
Heh... guess he OP is still thinking about that. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply