I'm trying to query the maximum size of a SQL Azure database using code from this answer:
SELECT CONVERT(BIGINT, DATABASEPROPERTYEX('DatabaseOfInterestName', 'MaxSizeInBytes')) / 1024
The problem is I need to pass the database name there. Since I need this code in a Windows Azure application which has different configurations - for production use, for automatic build and for testing - and each configuration would use its own database I'll have to pass the database name into that SQL query and that's some extra wiring in my code.
Is there a way to tell DATABASEPROPERTYEX()
to query the property "from the current database" without specifying the database name explicitly?