Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Database Size

Status
Not open for further replies.

bowserj

MIS
Dec 12, 2000
29
US
I would like to write a script that will connect to a remote SQL server, and return the size of a specific database on that server.

I would then like to be able to write this information to a file for trend analysis. I can handle writing it to file however. I just need to know how to get the size of the remote database.

Thanks
 
"exec sp_databases" returns DB Name DB Size and DB Remarks
 
You'd probably need to create a new stored procedure that mimicks sp_databases (unless there is another one) that allows a parameter to be passed in, which is the database name. Otherwise you get the size of every database in that server...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top