Skip to content

Instantly share code, notes, and snippets.

@johndacosta
Created July 30, 2013 04:41
Show Gist options
  • Save johndacosta/6110295 to your computer and use it in GitHub Desktop.
Save johndacosta/6110295 to your computer and use it in GitHub Desktop.
Get files sizes for sql server. intentionally using old table due to desire to support sql 2000
-- http://msdn.microsoft.com/en-us/library/ms181338.aspx
select
@@servername as ServerName, db_name(dbid) as DatabaseName,dbid,fileid,groupid, size, size * 8 sizeKB, maxsize, growth, status, name, filename
from master.dbo.sysaltfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment