09-07-2015 02:12 PM
Hello,
We have an error duing upgrade process of the VaultStore DB (ID 41533), after checking the script manually, it seems we have duplicate key in the DB
The current compatibility level is 100.
Msg 1505, Level 16, State 1, Line 4
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.Saveset' and the index name 'UN_Saveset_VaultIdentity'. The duplicate key value is (6, 1).
The statement has been terminated.
Msg 1776, Level 16, State 0, Line 5
There are no primary or candidate keys in the referenced table 'dbo.Saveset' that match the referencing column list in the foreign key 'FK_SavesetContent_Saveset2'.
Msg 1750, Level 16, State 0, Line 5
Could not create constraint. See previous errors.
Is someone have an idea to track Duplicate key or experience the same issue ?
Solved! Go to Solution.
09-08-2015 02:02 AM
Our duplicate was a PF Archive, so we have to delete it to be able to migrate....no choice..because no export available on Public Folder Archive
09-07-2015 02:52 PM
this is the right query to check about duplicate key (just change the VS Name)
USE EVVSExpressVaultStore_1
GO
WITH CTE AS (
SELECT VaultIdentity, IndexSeqNo, COUNT(*) AS [NumberOfInstances]
FROM dbo.Saveset
GROUP BY VaultIdentity, IndexSeqNo
HAVING COUNT(*) > 1
)
SELECT
CTE.VaultIdentity
,CTE.IndexSeqNo
,CTE.NumberOfInstances
,a.ArchiveName
,ap.ArchivedItems AS ItemsInArchive
,r.RootIdentity
,v.VaultID AS VaultEntryId
,afv.FolderName
,afv.FolderPath
FROM Vault AS v
JOIN [EnterpriseVaultDirectory].[dbo].[Root] AS r
ON r.VaultEntryId = v.VaultID
JOIN [EnterpriseVaultDirectory].[dbo].[ArchiveFolderView] AS afv
ON afv.RootIdentity = r.RootIdentity
JOIN [EnterpriseVaultDirectory].[dbo].[Archive] AS a
ON a.RootIdentity = afv.ContainerRootIdentity
JOIN ArchivePoint AS ap
ON ap.ArchivePointIdentity = v.ArchivePointIdentity
JOIN CTE
ON CTE.VaultIdentity = v.VaultIdentity
WHERE v.VaultIdentity IN (SELECT DISTINCT VaultIdentity FROM CTE)
ORDER BY ArchiveName
09-08-2015 02:02 AM
Our duplicate was a PF Archive, so we have to delete it to be able to migrate....no choice..because no export available on Public Folder Archive