aboutspaceused
点击次数:36 次 发布日期:2008-11-22 13:38:55 作者:源代码网
|
declare @TableName varchar(200) create table #tmpTable(name nvarchar(20),rows char(11),reserved varchar(18),data varchar(18),index_size varchar(18),unused varchar(18)) DECLARE myCursor CURSOR FOR select name from sysobjects where type="u" OPEN myCursor FETCH NEXT FROM myCursor into @TableName WHILE @@FETCH_STATUS = 0 BEGIN insert into #tmptable exec sp_spaceused @TableName FETCH NEXT FROM myCursor into @TableName END CLOSE myCursor DEALLOCATE myCursor select * from #tmpTable drop table #tmpTable 源代码网供稿. |
