SQL Server – Get Physical Names and Attributes of Database Files

Contributor Icon Contributed by shamanstears Date Icon October 17, 2006  
Tag Icon Tagged: Database

You can get the file location, size, maxsize, growth and usage attributes of a database without leaving your Enterprise Manager or Management Studio. To do this:


1. Open the query window.

2. Select the database that you will be requesting information on.

3. Type exec sp_helpfile.

4. Execute the query.

The results set will include the database name, fileid, filename, filegroup, size, maxsize, growth and usage for both the data file and the log file.

Previous recipe | Next recipe |
 
blog comments powered by Disqus