October 1, 2008 at 8:21 pm
is there a way, i dump sp_spaceused output to table? if yes, can someone please share how?
Many thanks,
October 1, 2008 at 9:33 pm
Getting Output from a Stored Procedure into a Table
http://www.databasejournal.com/features/mssql/article.php/3386661
or you may need this for all the tables (SQL2000/SQL2005):
http://www.sqlservercentral.com/scripts/Miscellaneous/62468/
October 2, 2008 at 5:49 am
The basic syntax is:
INSERT myTable EXEC someProcedure
'sp_spaceused myTableName' returns a single resultset, so just create a table matching the output, and then use the INSERT EXEC syntax.
'sp_spaceused' alone otoh returns two resultsets with different #columns.
If you want to collect these, then I'd probably just make my own version of sp_spaceused in order to gain control of what and how results are returned.
/Kenneth
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply