select * into tablex from department where 1=1
Select a.name AS 字段名, b.name AS 类型,a.length as 占用字节数,(case when a.isnullable=1 then '√' else '' end)as 是否为空,(g.[value]) as 说明 FROM syscolumns a INNER JOIN systypes b ON a.xusertype = b.xusertype INNER JOIN sysobjects d ON a.id = d.id AND d.xtype = 'U' AND d.name <> 'dtproperties' left join sys.extended_properties g on a.id=g.major_id AND a.colid = g.minor_id Where (d.name = 'department') ORDER BY a.id