查詢表裏面的字段名、字段類型及含義

select 
a.DESC0,
a.DID,
case when b.xusertype ='167' then 'varchar('+convert(varchar(10),b.length)+')'
when b.xusertype ='61' then 'datetime'
when b.xusertype ='36' then 'GUID'
when b.xusertype ='108' then 'numeric'
    else 'Null'
    end as Type
from SMTMPSD a
left join syscolumns b on A.DID=b.name
where a.SGUID='52ff2194-cafc-4c98-b468-09230355244e'        --指定一個場景
 and b.ID=OBJECT_ID('REISF_1')--指定表名稱
order by a.ZORDER


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