Wednesday, March 28, 2012

How to get the SQL database size

Is it possible to get the SQL Server database size programmatically?
I have an WEB application in c# ASP NET, but I can found any information about.

Thanks for your attention

Freedeveloperread this post:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=601604|||Hello!

Ok, Thank for the help.
I resolve the question in microsoft c# forum wit the use of sp_helpdb

SqlCommand cmd = new SqlCommand("sp_helpdb",objConexion);
cmd.CommandType=CommandType.StoredProcedure;
cmd.Parameters.Add("@.dbname",databasename);

this store procedure return the database size and another data.

thaks,

Freedevelopersql

No comments:

Post a Comment