Feb 16, 2012 at 8:32 PM
Edited Feb 16, 2012 at 8:33 PM
I haven't seen this anywhere, but creating BI.QUALITY test queries that include subqueries using the WITH clause fail, even though the same queries can be executed in MS SQL Management Studio without error. When I run these queries inside N-Unit I get:
BI.Quality.QueryTest.3-General\5-StaffDimension\DimStaffADPIDoverlappingDates:Exception ouccured while executing the query: Deferred prepare could not be completed.Statement(s) could not be prepared.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.
I cannot terminate the preceding statement with a semicolon because there is no preceding statement. the WITH clause is effectively the first statement in the query.
Any help would be appreciated.