SQL 데이터베이스 정보 획득 코드

 
SELECT Name FROM Master..SysDatabases ORDER BY Name --
SELECT Name FROM [ ]..SysObjects Where XType='U' ORDER BY Name --
select name from syscolumns where id=object_id(N' ') --
-표 필드 이름,유형,증가,설명 가 져 오기
 
select syscolumns.name as ,syscolumns.isnullable as ,systypes.name as SQL ,
ISNULL(sys.identity_columns.is_identity,0) as ,
ISNULL(sys.extended_properties.value,'') as from sysobjects
join syscolumns on sysobjects.id = syscolumns.id
join systypes on syscolumns.xusertype = systypes.xusertype
left join sys.identity_columns on sys.identity_columns.object_id = syscolumns.id
and sys.identity_columns.column_id = syscolumns.colid
left join sys.extended_properties on sys.extended_properties.major_id = syscolumns.id
and sys.extended_properties.minor_id = syscolumns.colid
where sysobjects.name = ' '

좋은 웹페이지 즐겨찾기