Error in creating upgrade script
m.vanderwilt
Posts: 5
I'm getting an invalid upgrade script when letting SQLCompare generate this table:
Original table code in the database:
Code resulting in an error in the upgrade file generated by SQLCompare
The error occures in the [AltKey] computed column.
Running the create statement created by SQLCompare results in this error:
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near '('.
Both the source as target database are Microsoft SQL Server 2012.
We're using SQL Compare 10.2.3.1
How can i resolve this?
Original table code in the database:
CREATE TABLE [Dts].[ProcessInterference]( [ProcessCode] [nvarchar](50) NOT NULL, [ProcessCode2] [nvarchar](50) NOT NULL, [Description] [nvarchar](100) NOT NULL, [AltKey] AS (case when [ProcessCode]<[ProcessCode2] then concat([ProcessCode],';',[ProcessCode2]) else concat([ProcessCode2],';',[ProcessCode]) end), CONSTRAINT [pk_ProcessInterference] PRIMARY KEY CLUSTERED ( [ProcessCode] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], CONSTRAINT [ProcessInterference_AltKey] UNIQUE NONCLUSTERED ( [AltKey] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
Code resulting in an error in the upgrade file generated by SQLCompare
CREATE TABLE [Dts].[ProcessInterference] ( [ProcessCode] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [ProcessCode2] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Description] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [AltKey] AS (case when [ProcessCode]<[ProcessCode2] then [concat]([ProcessCode],';',[ProcessCode2]) else [concat]([ProcessCode2],';',[ProcessCode]) end) )
The error occures in the [AltKey] computed column.
Running the create statement created by SQLCompare results in this error:
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near '('.
Both the source as target database are Microsoft SQL Server 2012.
We're using SQL Compare 10.2.3.1
How can i resolve this?
Comments
sqlcompare /argFile:"TestArgsFile.xml"
TestArgsFile: