獲取SQL SERVER數據庫表結構

select a.name,
b.name + '('+ convert(varchar,a.length) + ')' + case a.isnullable when 1 then ' Null' else '' end as [type],
'' as Pretty
 from syscolumns a join systypes b
on (a.xusertype = b.xusertype)
where a.id = object_id('TableName') Order By a.ColOrder


得到結果爲:


wKiom1YcdCyhC7sUAADXggZl7hg926.jpg

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章