I have a strange issue, when I run locally the publish script works fine and when run through pipeline it gives me an error:
Incorrect syntax near the keyword 'with'. this statement is a common table expression, an xml namespaces clause or a change tracking context c
the previous statement must be terminated with a semi colon
There are multiple scripts being called and some of the earlier one with same syntax goes through but fails another one at a later stage.
PRINT 'Something';
GO; --I have tried removing this line, removing the semi colon as well but I get the same error
WITH [Target] AS (
SELECT * FROM [TABLE_NAME] AS T
)
, [Source] AS(
SELECT * FROM (VALUES
(1,'ABC')
,(2, 'XYZ')
) AS S(
[ID]
,[NAME]
)
)
//Some more statements
GO