如何将ms sql表结构形成文本件以便打印?

在企业管理器中,可以通过在表名上右击,选design table显示表结构属性,
如何将此表形成文本文件打印出来?
---------------------------------------------------------------

右鍵該table 在"所有工作"菜單中有 Generate SQL Script 菜單
即可以生成該表的原始代碼檔

如果右鍵某數據庫進行同樣的操作
可以生成該數據庫所有對象(表,存儲過程等)的原始代碼檔

所有結構一目了然
---------------------------------------------------------------

select c.name,a.name ,b.name ,a.length, a.isnullable from syscolumns a, systypes b ,sysobjects c where a.xtype=b.xusertype and a.id =c.id and c. type ='U'
---------------------------------------------------------------

如果具体到某一个表如table1
select c.name,a.name ,b.name ,a.length, a.isnullable from syscolumns a, systypes b ,sysobjects c where a.xtype=b.xusertype and a.id =c.id and c. type ='U'
and c.name='table1'

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus