views:

21

answers:

1

Hi guys,

In SQL Server, there are some *DMV*s that appear in all databases and have the same content in it. What's the purpose of this approach? For example, the following 2 query will give the same result.

select *
from   master.sys.databases

select *
from   tempdb.sys.databases

Thanks.

+3  A: 

sys.databases only exists once (actually in the hidden resource database)

All you are doing above is switching db context temporarily by using a 3 part object name

gbn