sqlserver 내 보 내기 데이터베이스 테이블 구조

1112 단어 sqlserver
SELECT
     = case when a.colorder=1 then d.name else '' end,
      = case when a.colorder=1 then isnull(f.value,'') else '' end,
       = isnull(g.[value],''),
       = a.name,
     = b.name,
     = COLUMNPROPERTY(a.id,a.name,'PRECISION'),
     = case when exists(SELECT 1 FROM sysobjects where xtype='PK' and name in(
  SELECT name FROM sysindexes WHERE indid in(8            
  SELECT indid FROM sysindexkeys WHERE id = a.id AND colid=a.colid 
  ))) then '√' else '' end,
     =isnull(e.text,''),
     =case when a.isnullable=1 then '√'else '' end
  FROM syscolumns a 
  left join systypes b on a.xtype=b.xusertype 
  inner join sysobjects d on a.id=d.id and d.xtype='U' and d.name<>'dtproperties' 
  left join syscomments e on a.cdefault=e.id 
  left join sys.extended_properties g on a.id=g.major_id and a.colid=g.minor_id  
  left join sys.extended_properties f on d.id=f.major_id and f.minor_id =0 
  where d.name='' --        ,      
  order by a.id,a.colorder 

좋은 웹페이지 즐겨찾기