SELECT * FROM sys.databases

In running the query below, does the resulting list of databases mean that each database on a SQL server has a table which lists the other co-located databases? Or, is this query actually getting data external to the database itself?

SELECT * FROM sys.databases

Thank you!
JohnD
LVL 1
John DarbyPMAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
lcohanConnect With a Mentor Database AnalystCommented:
Yes is in a master DB table hidded since 2005 and up so they can't be modified anymore. One Row per each database indeed and they are inserted at db creation time. Mode details in select * from sys.database_files for each physical file - just run the query inside each db on that server.
0
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
its actually fetching the data from 'sys' views;
0
 
lcohanDatabase AnalystCommented:
"Contains one row per database in the instance of Microsoft SQL Server."


http://msdn.microsoft.com/en-us/library/ms178534(v=sql.100).aspx
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Steve WalesConnect With a Mentor Senior Database AdministratorCommented:
For further reading on the sys.* views, you may also want to check out:

http://msdn.microsoft.com/en-us/library/ms174365
http://msdn.microsoft.com/en-us/library/ms177862

sys.databases isn't actually a table, it's a system view and what you can see in it depends upon your security on the user you're running the query as
0
 
John DarbyPMAuthor Commented:
Thank you, each! I am feeling a bit dense here...WHERE is the (meta)data stored? In the MASTER DB?
0
 
John DarbyPMAuthor Commented:
lcohan, I se your answer, and from whence you quoted the line, but it seems odd that each SQL Server DB would have one row of system data inscribed into each?
0
 
John DarbyPMAuthor Commented:
Thank you for the splendid education! :)
0
All Courses

From novice to tech pro — start learning today.