원문 : http://www.ischo.net -- 조인상 // 시스템 엔지니어

Writer : http://www.ischo.net -- ischo // System Engineer in Replubic Of Korea

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

원문 : http://www.ischo.net -- 조인상 //시스템 엔지니어

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

MS-SQL에서 전체 테이블리스트 + 테이블당 스키마구조 긁어오는 Query


 

select cl.TABLE_NAME as [TABLE], cl.COLUMN_NAME as [NAME], cl.IS_NULLABLE as [ISNULL], cl.DATA_TYPE as [TYPE], cl.CHARACTER_MAXIMUM_LENGTH as [LENGTH], kcu.COLUMN_NAME AS [KEYS], kcu.ORDINAL_POSITION as [POSITION]
from INFORMATION_SCHEMA.COLUMNS cl LEFT OUTER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu
on cl.TABLE_NAME = kcu.TABLE_NAME and cl.COLUMN_NAME = kcu.COLUMN_NAME and cl.ORDINAL_POSITION = kcu.ORDINAL_POSITION;

 

 

 

 

서버에 요청 중입니다. 잠시만 기다려 주십시오...