SQL语句查询表中缺失自增键
SELECT RecordId + 1
FROM dbo.RedeployPackageRecord RPR ( NOLOCK )
WHERE NOT EXISTS ( SELECT 1
FROM dbo.RedeployPackageRecord RPR2 ( NOLOCK )
WHERE RPR.RecordId + 1 = rpr2.RecordId )