Hello,
We are upgrading our server from SQL Server 2008 R2 Std. Ed. to SQL Server 2014 Std. Ed.
Our server works with Merge and Transactional publications.
Our current problem happens when trying to generate the first snapshot using the snapshot agent. Since this is the first time, the snapshot will create all the system tables related with replication and the error happens when creating the table MSmerge_conflict_<publication>_<article> because now the snapshot agent is trying to create the constraints from the <article> (a table in our case) with the same name, so it brings the conflict of having duplicated constraints names and because of that the snapshot agent fails. This didn't happen on 2008 because the snapshot agent didn't try to create the constraints before.
This is the error that we see on the Snapshot Agent Status:
There is already an object named"NewAccountPermission" in the database. Could not create constraint or index. See previous errors.
The exact T-sql statement that is failing is shown on the replication monitor:
Error messages:
Message: There is already an object named 'NewAccountPermission' in the database.
Could not create constraint or index. See previous errors.
Command Text: CREATE TABLE [dbo].[MSmerge_conflict_Roster_AccountPermissions](
[AccountPermissionID] [int] NOT NULL CONSTRAINT [NewAccountPermission] DEFAULT ([dbo].[getNewAccountPermissionID]()),
[PermissionName] [varchar](255) NULL,
[Description] [varchar](255) NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL
Digging a bit further I searched and compared the snapshot files that creates this table. Here it can be seen that the snapshot files only differ on the creation or not of the constraint.
Here is an extract o f the 2014 file called AccountPermissions_3.cft
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MSmerge_conflict_Roster_AccountPermissions](
[AccountPermissionID] [int] NOT NULL CONSTRAINT [NewAccountPermission] DEFAULT ([dbo].[getNewAccountPermissionID]()),
[PermissionName] [varchar](255) NULL,
[Description] [varchar](255) NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL
)
Here is the 2008 version of the same file:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MSmerge_conflict_Roster_AccountPermissions](
[AccountPermissionID] [int] NOT NULL,
[PermissionName] [varchar](255) NULL,
[Description] [varchar](255) NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL
)
Any ideas on what is going on? Do I have to configure some properties on the publication now to disallow creating the constraints on the msmerge_conflict table?
Thank you,
Alejandro Rivera