获得表信息 字段名等

来源:互联网 发布:自学java难吗 编辑:程序博客网 时间:2024/06/02 01:59

Select O.Name as TableName,C.Name as ColumnName,C.Colid,T.Name as Type,C.Length, case c.isnullable when 1 then 'Null'else 'No Null'end as IS_NULLABLE from syscolumns c join sysobjects o on c.id=o.id and o.Xtype='U'and O.Name<>'dtproperties' join systypes t on c.XuserType=T.XuserType Order By O.Name,C.colid