sql server查詢所有表名、欄位名、類型、長度 和 預存程序、視圖 的建立語句,sql預存程序

來源:互聯網
上載者:User

sql server查詢所有表名、欄位名、類型、長度 和 預存程序、視圖 的建立語句,sql預存程序

-- 獲得預存程序建立語句select o.xtype,o.name,cm.text from syscomments cm inner join sysobjects o on o.id=cm.id where xtype ='p'order by o.xtype,o.name,cm.text-- 獲得視圖程建立語句select o.xtype,o.name,cm.text from syscomments cm inner join sysobjects o on o.id=cm.id where xtype ='v'order by o.xtype,o.name,cm.text-- 查詢所有表名、欄位名、類型、長度select o.name, c.name,t.name,c.length from syscolumns cinner join systypes t on c.xtype= t.xtypeinner join sysobjects o on c.id= o.idwhere   o.xtype='u' order by  o.name, c.name,t.name-- 所有資料都來自於這四張表--select * from sysobjects--select * from syscolumns--select * from syscomments--select * from systypes


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.