[MSSQL] TABLE(테이블) 정의서 작성 쿼리
DB 테이블 정의서가 필요할 때 사용 SELECT A.TABLE_NAME, A.ORDINAL_POSITION, CASE WHEN C.TABLE_NAME IS NOT NULL THEN 'PK' ELSE '' END PK , A.COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, IS_NULLABLE, COLUMN_DEFAULT, B.DESCRIPTION FROM INFORMATION_SCHEMA.COLUMNS A LEFT OUTER JOIN (SELECT a.object_id AS TABLE_ID, a.name AS TABLE_NAME, b.name AS COLUMN_NAME, b.column_id AS COLUMN_ID, c.value AS DESCRIPTION FR..
Database/MSSQL
2023. 1. 5. 14:37