I have the next query that I run via SQLCMD.EXE
use [AxDWH_Central_Reporting]
GO
EXEC sp_spaceused @updateusage = N'TRUE'
GO
That return 2 tables... and uglu output file with the next conent:
Changed database context to 'AxDWH_Central_Reporting'. database_name Pdatabase_size Punallocated space --------------------------------------------------------------------------------------------------------------------------------P------------------P------------------ AxDWH_Central_Reporting P10485.69 MB P7436.85 MB reserved Pdata Pindex_size Punused ------------------P------------------P------------------P------------------ 3121176 KB P3111728 KB P7744 KB P1704 KB ----------------------------------------------------------------
Is it possible to make it shorter? Exactly I need only database_name and database_size values.. I tryed SQL queryes like
SELECT database_name, database_size FROM (EXEC sp_spaceused @updateusage = N'TRUE') AS tbl1
but this is not working.