SELECT C.TABLE_NAME, C.COLUMN_NAME, C.DATA_TYPE, C.CHARACTER_MAXIMUM_LENGTH, C.NUMERIC_PRECISION, C.IS_NULLABLE, TC.CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.COLUMNS AS C
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS TC
ON TC.TABLE_SCHEMA = C.TABLE_SCHEMA
AND TC.TABLE_NAME = C.TABLE_NAME
AND TC.CONSTRAINT_TYPE = 'PRIMARY KEY'
ORDER BY C.TABLE_NAME
MS-SQL LPAD RPAD 따라하기 (0) | 2015.01.15 |
---|---|
MS-SQL 자체 암호화 처리 방법 (0) | 2015.01.15 |
여러 칼럼들 중 최대값 구하기 (0) | 2014.09.18 |
RPAD 구현 (0) | 2014.09.18 |
varchar 와 nvarchar (0) | 2014.07.16 |