Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 how to know filenames of a given db

Author  Topic 

ozSQLServer
Starting Member

32 Posts

Posted - 2011-10-05 : 19:47:34
Hi,

In SQL Server 2008, in the following query, how can I obtain the filename beside the file_id?


SELECT i.file_id ,sample_ms ,num_of_reads ,num_of_bytes_read 
FROM sys.dm_io_virtual_file_stats(DB_ID(N'MYDB'), NULL)


Cheers,
ozSQL

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-05 : 19:48:54
Check out sys.master_files for all of them or sys.database_files for the current database.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

ozSQLServer
Starting Member

32 Posts

Posted - 2011-10-05 : 20:16:44
Thanks.

Cheers,
ozSQL
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-05 : 20:22:41


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -