Toad World® Forums

Script to find file Size of all databases and Tables size in a database in a SQL Server Instance - Non Volitile Scripts [2 Attachments]


#1

[ Attachment(s) from Hank Freeman included below]

To all my friends and associates on this Board I am sending you two scripts I
needed to create this last year that you may find useful.

They are SELECT only scripts that work for both SS 2000 à 2008.

image003.jpeg

image001.gif

image001.jpeg
image002.jpeg


#2

Being a newbie to the programming world (started developing about 5 years ago) I
can say that your insight has helped me with a great deal of issues I have come
across. Thanks Hank for all of your posts and ideas. I will truly miss it.
image001.gif


#3

Being a newbie to the programming world (started developing about 5 years ago) I
can say that your insight has helped me with a great deal of issues I have come
across. Thanks Hank for all of your posts and ideas. I will truly miss it.
image001.jpeg


#4

Being a newbie to the programming world (started developing about 5 years ago) I
can say that your insight has helped me with a great deal of issues I have come
across. Thanks Hank for all of your posts and ideas. I will truly miss it.
image002.jpeg


#5

Hank,

The scripts are being stripped out by Outlook. Any chance you can resend them
in a .zip file?

Thanks,

Darren
image002.jpeg


#6

Hank,

The scripts are being stripped out by Outlook. Any chance you can resend them
in a .zip file?

Thanks,

Darren
image001.jpeg


#7

Hank,

The scripts are being stripped out by Outlook. Any chance you can resend them
in a .zip file?

Thanks,

Darren
image001.gif


#8

Thanks Sir for the compliment…. Hope you enjoy the sql stuff I sent
along, nothing big just informative.

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image002.jpeg


#9

Thanks Sir for the compliment…. Hope you enjoy the sql stuff I sent
along, nothing big just informative.

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image002.jpeg


#10

Thanks Sir for the compliment…. Hope you enjoy the sql stuff I sent
along, nothing big just informative.

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image001.jpeg


#11

Thanks Sir for the compliment…. Hope you enjoy the sql stuff I sent
along, nothing big just informative.

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image001.gif


#12

[ Attachment(s) from Hank Freeman included below]

Darren Here you go !!!

FN_Compute_Run_ time.SQL - Accurately computes the run time of a procedure if
you pass the beg and end time to the function

FN_Convert_Date_ Time_to_STR. SQL - converts the date and time to a
YYYYMMDDHHmmss

SCRIPT_Kill all current connections - self explanatory

SCRIPT_Table_ Size_Info( 2000-2008) .sql - script to report MDF,NDF,LDF file
size and location for all active databases attached to instance

SCRIPTRef_Cur_ File_Size_ Base_SS-2000_ WIP.sql - Returns the table sizes of a
database

Hank Freeman

hfreeman@msn. com

678,414.0090

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image002.jpeg


#13

[ Attachment(s) from Hank Freeman included below]

Darren Here you go !!!

FN_Compute_Run_ time.SQL - Accurately computes the run time of a procedure if
you pass the beg and end time to the function

FN_Convert_Date_ Time_to_STR. SQL - converts the date and time to a
YYYYMMDDHHmmss

SCRIPT_Kill all current connections - self explanatory

SCRIPT_Table_ Size_Info( 2000-2008) .sql - script to report MDF,NDF,LDF file
size and location for all active databases attached to instance

SCRIPTRef_Cur_ File_Size_ Base_SS-2000_ WIP.sql - Returns the table sizes of a
database

Hank Freeman

hfreeman@msn. com

678,414.0090

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image002.jpeg


#14

[ Attachment(s) from Hank Freeman included below]

Darren Here you go !!!

FN_Compute_Run_ time.SQL - Accurately computes the run time of a procedure if
you pass the beg and end time to the function

FN_Convert_Date_ Time_to_STR. SQL - converts the date and time to a
YYYYMMDDHHmmss

SCRIPT_Kill all current connections - self explanatory

SCRIPT_Table_ Size_Info( 2000-2008) .sql - script to report MDF,NDF,LDF file
size and location for all active databases attached to instance

SCRIPTRef_Cur_ File_Size_ Base_SS-2000_ WIP.sql - Returns the table sizes of a
database

Hank Freeman

hfreeman@msn. com

678,414.0090

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image001.gif


#15

[ Attachment(s) from Hank Freeman included below]

Darren Here you go !!!

FN_Compute_Run_ time.SQL - Accurately computes the run time of a procedure if
you pass the beg and end time to the function

FN_Convert_Date_ Time_to_STR. SQL - converts the date and time to a
YYYYMMDDHHmmss

SCRIPT_Kill all current connections - self explanatory

SCRIPT_Table_ Size_Info( 2000-2008) .sql - script to report MDF,NDF,LDF file
size and location for all active databases attached to instance

SCRIPTRef_Cur_ File_Size_ Base_SS-2000_ WIP.sql - Returns the table sizes of a
database

Hank Freeman

hfreeman@msn. com

678,414.0090

Hank Freeman

Senior Systems, Database/Data Warehouse Architect

hfreeman@msn. com

678.414.0090 my cell Primary
image001.jpeg