Hi,
If I want to store the result of "sp_spaceused XXX" into a table? What
shall I do?
Thanks a lot!
MichaelCREATE TABLE #foo
(
tablename SYSNAME,
[rows] INT,
reserved VARCHAR(32),
data VARCHAR(32),
index_size VARCHAR(32),
unused VARCHAR(32)
);
INSERT #foo EXEC sp_spaceused 'table_name';
SELECT * FROM #foo;
DROP TABLE #foo;
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Michael" <michaelnx@.gmail.com> wrote in message
news:1176318829.693610.312820@.b75g2000hsg.googlegroups.com...
> Hi,
> If I want to store the result of "sp_spaceused XXX" into a table? What
> shall I do?
> Thanks a lot!
> Michael
>|||On Apr 11, 4:26 pm, "Aaron Bertrand [SQL Server MVP]"
<ten...@.dnartreb.noraa> wrote:
> CREATE TABLE #foo
> (
> tablename SYSNAME,
> [rows] INT,
> reserved VARCHAR(32),
> data VARCHAR(32),
> index_size VARCHAR(32),
> unused VARCHAR(32)
> );
> INSERT #foo EXEC sp_spaceused 'table_name';
> SELECT * FROM #foo;
> DROP TABLE #foo;
> --
> Aaron Bertrand
> SQL Server MVPhttp://www.sqlblog.com/http://www.aspfaq.com/5006
> "Michael" <michae...@.gmail.com> wrote in message
> news:1176318829.693610.312820@.b75g2000hsg.googlegroups.com...
>
> > Hi,
> > If I want to store the result of "sp_spaceused XXX" into a table? What
> > shall I do?
> > Thanks a lot!
> > Michael- Hide quoted text -
> - Show quoted text -
Thank you very very much!!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment