SELECT A.NAME AS 表名,B.NAME AS 主键名
FROM SYSOBJECTS A
JOIN SYSOBJECTS B
ON A.ID=B.PARENT_OBJ
AND A.XTYPE='U' AND B.XTYPE='PK'
SELECT A.NAME AS 表名,B.NAME AS 主键名
FROM SYSOBJECTS A
JOIN SYSOBJECTS B
ON A.ID=B.PARENT_OBJ
AND A.XTYPE='U' AND B.XTYPE='PK'