달력

42024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
select col.name, col.column_id, st.name as DT_name, col.max_length, col.is_nullable, col.is_identity, defCst.definition 
from sys.columns col left outer join sys.types st on st.user_type_id = col.user_type_id 
left outer join sys.default_constraints defCst on defCst.parent_object_id = col.object_id and defCst.parent_column_id = col.column_id 
where col.object_id = object_id(N'dbo.Music') order by col.column_id
아래 이미지는 실행 결과..

컬럼의 이름, 아이디, 형식 , 크기, null, identity, 기본 값 이 나온다. (원래는 더 많은 정보가 나오지만 필요한것만 나오도록 엄청 많이 삭제....)

Posted by SadDev
|