找出某 Table 的欄位資料

找出某 Table 的欄位資料

 

Select A.[id] as TableId ,C.[name] as TabneName  ,A.[name] as field,  
       B.[name] + '('  + cast(A.[length] as varchar )+ ')' as TypeD
From [syscolumns] as A , [systypes] as B, [sysobjects] as C
Where A.xtype=B.xtype and A.[id] = C.[id]  
  and C.[name]='ResutTbl'  --  <== 請自行更改為要查詢的 Table Name
Order by A.colorder