alter table entity_kcmxbbak DROP CONSTRAINT PK_Entity_KCMXB
select TABLE_NAME from all_constraints where CONSTRAINT_NAME='PK_Entity_KCMXB'
SELECT
tab.name
AS [表名],
idx.name
AS [主键名称],
col.name
AS [主键列名]
FROM
sys.indexes idx
JOIN sys.index_columns idxCol
ON (idx.object_id = idxCol.object_id
AND idx.index_id = idxCol.index_id
AND idx.is_primary_key = 1)
JOIN sys.tables tab
ON (idx.object_id = tab.object_id)
JOIN sys.columns col
ON (idx.object_id = col.object_id
AND idxCol.column_id = col.column_id)
where idx.name
='PK_Entity_KCMXB'
select TABLE_NAME from all_constraints where CONSTRAINT_NAME='PK_Entity_KCMXB'
SELECT
tab.name
AS [表名],
idx.name
AS [主键名称],
col.name
AS [主键列名]
FROM
sys.indexes idx
JOIN sys.index_columns idxCol
ON (idx.object_id = idxCol.object_id
AND idx.index_id = idxCol.index_id
AND idx.is_primary_key = 1)
JOIN sys.tables tab
ON (idx.object_id = tab.object_id)
JOIN sys.columns col
ON (idx.object_id = col.object_id
AND idxCol.column_id = col.column_id)
where idx.name
='PK_Entity_KCMXB'