- 특정 테이블만 알고 싶을때
EXEC sp_spaceused '테이블명';
- 특정디비의 모든 테이블에 대해서 알고 싶을때
use mousebbs
go
exec sp_MSforeachtable "exec sp_spaceused '?'"
- 조건에 따른
use mouseBBS
go
declare @tblName varchar(30)
declare curGetTableName INSENSITIVE CURSOR
for
select tableName from tableinfo where groupcode=2
for read only
open curGetTableName
fetch from curGetTableName into @tblname
while @@FETCH_STATUS = 0
begin
exec sp_spaceused @tblName
FETCH FROM curGetTableName INTO @tblName
end
close curGetTableName
deallocate curGetTableName
go
날짜: 2005-10-11 11:58:27,
조회수: 3042 |