0

Is there a way to determine the max size of a SQL Server Express database using SMO?

Or will I have to add code to say

if express then
  if sql2005 then 
    limit = 4gb 
  else 
    limit = 10gb
else
  limit = unlimited
end
Dustin Gamester
  • 792
  • 3
  • 8
  • 24
  • just curious, what's the problem to add the code? – urlreader Oct 30 '12 at 18:19
  • @urlreader The problem is that when the database reaches 9gb there is no prompt saying "Your database is 90% full, please consider deleting files, or upgrading your version of sql server" – Dustin Gamester Oct 30 '12 at 19:20
  • http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.database.size.aspx – JeffO Oct 30 '12 at 20:18
  • @JeffO The Database.size property gives the size of the database, and the SpaceAvailable property gives how much empty space the database has – Dustin Gamester Oct 30 '12 at 20:43

0 Answers0