Monday, 4 May 2009

list all table sizes

This is a useful script for collecting table sizes with the number of rows

Print 'All table sizes with the number of rows'
print 'Server Name...............: ' + convert(varchar(30),@@SERVERNAME)
PRINT 'Current Date Time.........: ' + convert(varchar(30),getdate(),113)

EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"

No comments:

Post a Comment

Note: only a member of this blog may post a comment.