--查詢表字段和字段類型
select syscolumns.name,systypes.name from syscolumns,systypes where syscolumns.xusertype=systypes.xusertype
and syscolumns.id=object_id('p5010_case')
--查詢表字段和字段類型and 類型長度
select syscolumns.name,systypes.name,systypes.name+'('+cast(syscolumns.length/2 as varchar(10))+')',
syscolumns.length
from syscolumns,systypes
where syscolumns.xusertype=systypes.xusertype and syscolumns.id=object_id('p5010_case')