SELECT T1.TABLE_NAME, T1.COLUMN_NAME, DATA_TYPE, IS_NULLABLE, CHARACTER_MAXIMUM_LENGTH, COLUMN_DEFAULT, COLUMN_DESC FROM INFORMATION_SCHEMA.COLUMNS T1 LEFT OUTER JOIN ( SELECT T.NAME TABLE_NAME, TD.VALUE TABLE_DESC , C.NAME COLUMN_NAME, CD.VALUE COLUMN_DESC FROM SYSOBJECTS T INNER JOIN SYSUSERS U ON U.UID = T.UID LEFT OUTER JOIN SYS.EXTENDED_PROPERTIES TD ON TD.MAJOR_ID = T.ID AND TD.MINOR_ID = 0 AND TD.NAME = 'MS_Description' INNER JOIN SYSCOLUMNS C ON C.ID = T.ID LEFT OUTER JOIN SYS.EXTENDED_PROPERTIES CD ON CD.MAJOR_ID = C.ID AND CD.MINOR_ID = C.COLID AND CD.NAME = 'MS_Description' WHERE T.TYPE = 'u' ) T2 ON T2.TABLE_NAME=T1.TABLE_NAME AND T2.COLUMN_NAME=T1.COLUMN_NAME WHERE T1.TABLE_NAME in (select TABLE_NAME from information_schema.tables) ORDER BY T1.TABLE_NAME, ORDINAL_POSITION
2015년 7월 14일 화요일
테이블 컬럼 코멘트 조회
// MS SQL 테이블 컬럼 보기
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기