sql2005 字段问题
如:
表 person
personid int,
persnonname nvarchar(50),
sex bit,
age int
如何取字段的顺序号 ??
如 age 的顺序id 是4 ???
[解决办法]
select a.name as '字段名 ',a.column_id as '顺序号 ' from sys.columns a
inner join sys.objects b on a.object_id = b.object_id
where b.name = 'person '
and a.name = 'age '