SQL语句来获取一个表的所有列的信息,如,列名、类型、长度等
2008-10-31 11:04
|
本代码适用于: SQLSERVER2000/2005 select c.name, t.name as type, c.length ,(case t.name when 'nvarchar' then c.length/2 when 'nchar' then c.length/2 else c.length end) as reallength from syscolumns c join systypes t on c.xtype=t.xtype where t.name <> 'sysname' and c.id=object_id('Table1') |
转自:http://hi.baidu.com/jacksparrow01/blog/item/b53a7626bd84f404918f9de2.html
本文提供了一个SQL Server 2000/2005中用于查询指定表所有列信息(包括列名、类型及长度)的实用SQL语句示例。


1522

被折叠的 条评论
为什么被折叠?



