|
楼主 |
发表于 2009-1-26 07:32:10
|
显示全部楼层
给你帖个详细的,表名自己过滤
SELECT TOP 100 PERCENT dbo.sysobjects.name AS TableName,
dbo.syscolumns.colid AS FieldIndex, dbo.syscolumns.name AS FieldName,
dbo.sysproperties.[value] AS Describe, dbo.systypes.name AS FieldType,
dbo.syscolumns.length AS FieldSize, dbo.syscolumns.isnullable AS AllowNull
FROM dbo.syscolumns INNER JOIN
dbo.systypes ON dbo.syscolumns.xtype = dbo.systypes.xtype INNER JOIN
dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id LEFT OUTER JOIN
dbo.sysproperties ON dbo.syscolumns.id = dbo.sysproperties.id AND
dbo.syscolumns.colid = dbo.sysproperties.smallid
WHERE (dbo.sysobjects.xtype = 'U') AND (dbo.sysobjects.name <> 'dtproperties')
ORDER BY dbo.sysobjects.name, dbo.syscolumns.colid |
|