This project has moved and is read-only. For the latest updates, please go here.
1
Vote

Columns in Where condition are not put between brackets with SQL provider

description

For instance in the following query generated entirely by the tree (with a Condition property value of "= 1" for the Order field):
 
SELECT
[P].[Id] AS [ProcId],
[P].[Name],
[TS].[Order]
FROM
[MyDB].[schema].[Procedure] AS [P]
INNER JOIN [MyDB].[schema].[ProcItemGroup] AS [TS] ON ([P].[Id]=[TS].[ProcedureId])
INNER JOIN [MyDB].[schema].[ProcItem] AS [TIP] ON ([TS].[Id]=[TIP].[GroupId])
WHERE
([TS].Order = 1)
ORDER BY 1 DESC
 
Within the SELECT section, the query generates "[TS].[Order]", but within the WHERE section it generates "[TS].Order", which, as ORDER is a reserved word, fails to execute.

comments