SQL 数据库中所有的用户表,一个表的中的所有列信息 的SQL

SELECT OBJECT_NAME (id) [OBJECT_NAME] FROM sysobjects WHERE xtype = 'U' AND OBJECTPROPERTY (id, 'IsMSShipped') = 0

SELECT a.name ColName,b.name TypeName,a.length Length from  syscolumns a
INNER JOIN sysobjects d ON a.id=d.id AND d.xtype='U' AND d.name<>'dtproperties'
LEFT JOIN systypes b ON a.xtype=b.xusertype
WHERE
 d.name = '{0}'

你可能感兴趣的:(sql)