반응형
MSSQL 테이블 description 확인하는 쿼리
DECLARE @TABLE_NAME NVARCHAR(50) = '테이블이름';
SELECT D.COLORDER AS COLUMN_IDX -- Column Index , A.NAME AS TABLE_NAME -- Table Name , C.VALUE AS TABLE_DESCRIPTION -- Table Description , D.NAME AS COLUMN_NAME -- Column Name , E.VALUE AS COLUMN_DESCRIPTION -- Column Description , F.DATA_TYPE AS TYPE -- Column Type , F.CHARACTER_OCTET_LENGTH AS LENGTH -- Column Length , F.IS_NULLABLE AS IS_NULLABLE -- Column Nullable , F.COLLATION_NAME AS COLLATION_NAME -- Column Collaction Name FROM SYSOBJECTS A WITH (NOLOCK) INNER JOIN SYSUSERS B WITH (NOLOCK) ON A.UID = B.UID INNER JOIN SYSCOLUMNS D WITH (NOLOCK) ON D.ID = A.ID INNER JOIN INFORMATION_SCHEMA.COLUMNS F WITH (NOLOCK) ON A.NAME = F.TABLE_NAME AND D.NAME = F.COLUMN_NAME LEFT OUTER JOIN SYS.EXTENDED_PROPERTIES C WITH (NOLOCK) ON C.MAJOR_ID = A.ID AND C.MINOR_ID = 0 AND C.NAME = 'MS_Description' LEFT OUTER JOIN SYS.EXTENDED_PROPERTIES E WITH (NOLOCK) ON E.MAJOR_ID = D.ID AND E.MINOR_ID = D.COLID AND E.NAME = 'MS_Description' WHERE 1=1 AND A.TYPE = 'U' AND A.NAME = @TABLE_NAME ORDER BY D.COLORDER |
반응형
'Dev > Database' 카테고리의 다른 글
[Oracle] 오라클 날짜포맷 날짜형식 시간형식 yyyymmdd, hhmmss (0) | 2023.07.20 |
---|---|
[Oracle] 오라클 반올림함수, 올림함수, 내림함수, (0) | 2023.07.20 |
[Oracle] 테이블 컬럼 찾기 (0) | 2023.06.20 |
[Oracle] 프로시저 내용검색 (0) | 2023.06.20 |
[Oracle/DBeaver] 'Keep-Alive monitor' 에 문제점이 발생했습니다. Java heap space (메모리 부족 오류) / 메모리사용량 / 메모리증설 / 메모리추가 (0) | 2023.06.12 |