sqlserver查看表结构
SELECT t.name AS TableName, c.name AS ColumnName, c.system_type_id AS DataTypeID, s.name AS DataTypeName, c.max_length AS MaxLength, c.is_nullable AS IsNullable FROM sys.tables t INNER JOIN sys.columns c ON t.object_id = c.object_id LEFT OUTER JOIN sys.types s ON c.user_type_id = s.user_type_id WHERE t.name = 'YourTableName' --将"YourTableName"替换为要查询的表名 ORDER BY t.name, c.column_id;