Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *,
- COUNT(*) AS 'Contador Duplicados',
- 'Password' AS 'Nombre Tabla'
- FROM Person.Password P
- GROUP BY BusinessEntityID,
- PasswordHash,
- PasswordSalt,
- rowguid,
- ModifiedDate
- HAVING NOT EXISTS (
- SELECT *,
- COUNT(*)
- FROM Person.CopiaPassword PC
- GROUP BY BusinessEntityID,
- PasswordHash,
- PasswordSalt,
- rowguid,
- ModifiedDate
- HAVING PC.BusinessEntityID = P.BusinessEntityID
- AND PC.PasswordHash = P.PasswordHash
- AND PC.PasswordSalt = P.PasswordSalt
- AND PC.rowguid = P.rowguid
- AND PC.ModifiedDate = P.ModifiedDate
- AND COUNT(*) = COUNT(ALL P.BusinessEntityID))
- UNION
- SELECT *,
- COUNT(*) AS 'Contador Duplicados',
- 'CopiaPassword' AS 'Nombre Tabla'
- FROM Person.CopiaPassword PC
- GROUP BY BusinessEntityID,
- PasswordHash,
- PasswordSalt,
- rowguid,
- ModifiedDate
- HAVING NOT EXISTS (
- SELECT *,
- COUNT(*)
- FROM Person.Password P
- GROUP BY BusinessEntityID,
- PasswordHash,
- PasswordSalt,
- rowguid,
- ModifiedDate
- HAVING PC.BusinessEntityID = P.BusinessEntityID
- AND PC.PasswordHash = P.PasswordHash
- AND PC.PasswordSalt = P.PasswordSalt
- AND PC.rowguid = P.rowguid
- AND PC.ModifiedDate = P.ModifiedDate
- AND COUNT(*) = COUNT(ALL PC.BusinessEntityID));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement