cfquery stürzt ab, wenn es tsql-Kommentare gibt

Dies stürzt in ColdFusion 11 nicht ab, stürzt jedoch in ColdFusion 2016 ab.

SELECT  *
FROM    dbo.Roles WITH (NOLOCK)
WHERE   Code IS NOT NULL
AND     Active = 1
AND     RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) -- It's ok to look at termed employees

Dies funktioniert in beiden Fällen.

SELECT  *
FROM    dbo.Roles WITH (NOLOCK)
WHERE   Code IS NOT NULL
AND     Active = 1
AND     RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) 

Gibt es eine Einstellung, um das ursprüngliche Verhalten wiederherzustellen?

AKTUALISIERE

Ich dachte, ich hätte ein minimales Beispiel für das Problem, aber ich habe es nicht getan. Hier ist die vollständige Abfrage

    SELECT '<ul>' + STUFF (
        (
        SELECT  MIN(Role) AS "li/code", Code AS "li/span/b", 'Unsorted' AS "li/span/var"
        FROM    dbo.Roles WITH (NOLOCK)
        WHERE   Code IS NOT NULL
        AND     Active = 1
        AND     RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) -- It's ok to look at termed employees
        GROUP BY Code
        FOR XML PATH ('')
        ),
        1,0,''

    ) + '</ul>' AS xmlRole

Wenn ich das DB-Debugging einschalte, erhalte ich:

spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>> OK

spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>> Statement[4].execute(String sql, int autoGeneratedKeys)
spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>> sql = SELECT '<ul>' + STUFF ( ( SELECT MIN(Role) AS "li/code", Code AS "li/span/b", 'Unsorted' AS "li/span/var" FROM dbo.Roles WITH (NOLOCK) WHERE Code IS NOT NULL AND Active = 1 AND RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) -- It's ok to look at termed employees GROUP BY Code FOR XML PATH ('') ), 1,0,'' ) + '</ul>' AS xmlRole
spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>> autoGeneratedKeys = 1
spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>>    
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near ')'. ErrorCode=102 SQLState=HY000
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near ')'.
    at macromedia.jdbc.sqlserverbase.ddcw.b(Unknown Source)
    at macromedia.jdbc.sqlserverbase.ddcw.a(Unknown Source)

Beachten Sie, dass sich die SQL-Zeichenfolge in einer einzelnen Zeile befindet. Wenn der Kommentar beginnt, endet er nicht. Alles nach dem-- bleibt als auskommentiert.

White Space Management ist aktiviert. Das Ausschalten ändert nichts am Verhalten. Die generierte SQL ist die gleiche

Antworten auf die Frage(2)

Ihre Antwort auf die Frage