DB 에 있는 모든 테이블의 크기를 구하기 > db

본문 바로가기
사이트 내 전체검색

db

DB 에 있는 모든 테이블의 크기를 구하기

페이지 정보

작성자 서방님 댓글 0건 조회 127회 작성일 06-11-02 15:02

본문

sp_spaceused를 아셨다면 거의 답에 접근한 형태입니다.

그걸 userTable만 순환시켜주면 가능한 형태입니다.

create proc sp_tableinfo
as
set nocount on
     declare tab_cur cursor for
     select name from sysobjects where type='u'
 open tab_cur
     declare @tabname varchar(50)
     fetch from tab_cur into @tabname
     while (@@fetch_status=0)

     begin
          fetch next from tab_cur into @tabname
          exec ('sp_spaceused ' +  @tabname)
     end
set nocount off
close tab_cur
deallocate tab_cur

 

위의 과정은 그 것을 하는 것으로 sp_tableinfo가 만들어지게 됩니다.
그럼 실행을 해보세요.
보기 좋게 하려면 ctrl + T (텍스트로 결과보기)를 눌러 실행하시면 됩니다.

댓글목록

등록된 댓글이 없습니다.

Total 464건 27 페이지
게시물 검색

회원로그인

접속자집계

오늘
27
어제
302
최대
1,347
전체
155,088
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.