데이터베이스

Total 205
Today 0
profile_image
윤진한
08-05-20 17:55 0개 649회
MSSQL
테이블단위로 용량크기 확인
sysobjects 에 있는 항목들 중에서 사용자 테이블 인것만 가져와서
sp_spaceused를 이용하면 되겠네요.
 
 
set nocount on
declare size_cursor cursor
for
select name from sysobjects where xtype = 'U'
declare @tblname varchar(30)
open size_cursor
fetch next from size_cursor into @tblname
while (@@fetch_status=0)
begin
EXEC sp_spaceused @tblname
fetch next from size_cursor into @tblname
end
close size_cursor
deallocate size_cursor
go

추천 0 비추천 0

댓글목록

등록된 댓글이 없습니다.