Error HY000[319] when using WITH clause in MSSQL 2014

Posted by Nicolas Auvillain on 02-Jun-2017 14:40

I'm using the The SQL Server Wire Protocol Driver and if I run the following query:

WITH
test
AS
(
SELECT * FROM HumanResources.Department
)
SELECT * FROM test;

I get:

HY000[319][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

if I run the same in SQL Server management studio, it works fine; but if I use the SQL Server Wire Protocol Driver, I get that error.

That looks like a defect to me - the only non-default option I've selected is 'enable quoted identifiers'.

All Replies

Posted by eugenel on 02-Jun-2017 14:55

It should work as the driver does not do anything about the sql. Could you please provide us with more info, odbctrace, snoop, driver/server versions, and platform...? A repro will help here.

Posted by Nicolas Auvillain on 02-Jun-2017 15:23

Thanks - I'll check internally and get back to you if I have relevant information. It's good to know the driver doesn't do anything about the SQL.

This thread is closed