select COLUMN_NAME = convert(sysname,c.name)
from sysindexes i, syscolumns c, sysobjects o
where o.id = object_id('[asp_lookup]')
and o.id = c.id
and o.id = i.id
and (i.status & 0x800) = 0x800
and (c.name = index_col('[asp_lookup]', i.indid, 1)
)
sql server 中获得主键的方法
最新推荐文章于 2024-03-27 11:58:11 发布