This project is read-only.

Use SQL queries

Note that for example purposes, I assume that you have some deduplication rules for Contacts and some duplicates in your database.
  • Open SQL Server Management Studio, connect to the CRM Database as administrator and open a Query Window - Check that you have selected the correct database (and not the "master" one)
  • Run the following statements
CREATE TABLE #Duplicates (
    Id INTEGER IDENTITY(1,1) NOT NULL,
    RuleId UNIQUEIDENTIFIER,
    BaseEntityTypeCode INTEGER,
    BaseObjectId UNIQUEIDENTIFIER,
    MatchingEntityTypeCode INTEGER,
    MatchingObjectId UNIQUEIDENTIFIER,
    Matchcode NVARCHAR(450))

EXECUTE [dbo].[usp_ag_showdup] 'Contact', 1, 0

SELECT
    BaseContact.ContactId AS BaseId,
    BaseContact.FullName AS BaseFullName,
    BaseContact.Address1_PostalCode AS BaseZip, 
    MatchingContact.ContactId AS MatchingId,
    MatchingContact.FullName AS MatchingFullName,
    MatchingContact.Address1_PostalCode AS MatchingZip,
    DuplicateRule.Name AS RuleName
FROM #Duplicates INNER JOIN
 DuplicateRule ON #Duplicates.RuleId = DuplicateRule.DuplicateRuleId INNER JOIN
 Contact AS BaseContact ON #Duplicates.BaseObjectId = BaseContact.ContactId INNER JOIN
 Contact AS MatchingContact ON #Duplicates.MatchingObjectId = MatchingContact.ContactId AND #Duplicates.MatchingEntityTypeCode = 2
ORDER BY BaseContact.FullName, MatchingContact.FullName, RuleName


The resultset shows duplicates. You can customise the query above as needed.

Use SSRS

  • Deploy the DuplicateContactsReport.rdl and run it as administrator. You can customise the report as needed.

Last edited Jul 31, 2011 at 7:19 PM by gemina, version 2

Comments

No comments yet.