I can get all the datasets with SQLCMD execution (ugly). Is there a better programmatic way? Thanks.
CREATE TABLE #Space ( DB sysname, dbsize varchar(50), freespace varchar(50)); INSERT #Space EXEC sp_spaceused; /* expecting the second dataset definition Msg 213, Level 16, State 7, Procedure sp_spaceused, Line 128 Column name or number of supplied values does not match table definition */ /* database_name database_size unallocated space AdventureWorks2012 3118.38 MB 443.70 MB reserved data index_size unused 361776 KB 241704 KB 110352 KB 9720 KB */
Kalman Toth Database & OLAP Architect
sqlusa.com
Paperback / Kindle: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012