there is always something to develop
How to determine file names used by current database
Information about database's files are stored in master database and table sysaltfiles. To determine which database is current one we need to use db_name(). So we have:
SELECT db_name(dbid), * FROM master.dbo.sysaltfiles where db_name(dbid)=db_name() ORDER BY size DESC
See also
Comments
"Don't go around saying the world owes you a living; the world owes you nothing; it was here first "
You are 3776 reader
since 1st April 2009
Yes | 0 | |
No | 0 |