用sql获取表的主键

select   pkey.name  
  from   sysobjects   pkey,   sysobjects  
  where   sysobjects.name='TTT'   and   sysobjects.id=pkey.parent_obj
原文地址:https://www.cnblogs.com/no7dw/p/1740487.html