1

We have created one linked server with name

'server_linked_090215'

How do we get all database names which this linked server can access?

TechTalk
  • 51
  • 2
  • 4
  • I think you to list out all the databases in the linked server. Please refer this http://stackoverflow.com/questions/5806854/how-to-determine-if-database-exists-on-linked-server – SelvaS Sep 02 '15 at 11:09
  • Any updates SQL folk? – TechTalk Sep 03 '15 at 10:18

2 Answers2

1

you can use to get all DBs in SQL Server instance

SELECT name
FROM master..sysdatabases

for linked servers:

select * from server_linked_090215.master.sys.databases
Biswabid
  • 1,378
  • 11
  • 26
  • This will give all databases under same server. I want to know how many databases and which databases this linked server can access? – TechTalk Sep 02 '15 at 11:48
0

You can do something like this :

select * from server_linked_090215.master.sys.databases
Munahil
  • 2,381
  • 1
  • 14
  • 24
  • This will give all databases under same server as the Master database will be same for the the same server. I want to know how many databases and which databases this linked server can access? – TechTalk Sep 02 '15 at 11:49