728x90

1. DBMS 테이블 확인 

SELECT *
FROM information_schema.tables

뷰/테이블이 같이 나오므로 순수 테이블만 확인 하고 싶은 경우 다음과 같이 확인하면 됨. 뷰 확인은 TABLE_TYPE = 'VIEW' 로 하면 됨.

SELECT *
FROM information_schema.tables
WHERE table_type = 'base table'


2. DBMS 전체 TABLE별 ROW COUNT 확인

SELECT o.NAME,
 i.rowcnt
FROM sysindexes AS i
  INNER JOIN sysobjects AS o ON i.id = o.id
WHERE i.indid < 2  AND OBJECTPROPERTY(o.id, 'IsMSShipped') = 0
ORDER BY o.NAME

728x90

+ Recent posts