星期五, 12月 18, 2009

取得資料庫的表格名稱與欄位名稱的語法 – MS SQL

  • 表格名稱:

select name from dbo.sysobjects where xtype = 'u' order by name

  • 欄位名稱:

select name, type_name(xtype), length from syscolumns where id = object_id('TABLE_NAME') order by colid

沒有留言:

張貼留言