Bug - No Column Candidates in Subquery
BrianFinkel
Posts: 33
This is a reproducible problem for me:
SELECT (
SELECT TOP 1 Col1
FROM Table2 AS t2
WHERE t2.
) as val
FROM Table1 AS t1
In the query above, typing the '.' after WHERE t2 does not get any response from Sql Prompt. If you press CTL-SPC, it only suggests columns for t1. Same thing happens if you try to get candidates by doing a JOIN within the subquery.
My query is much more complex than this example, but I pared it down to demonstrate the problem.
Note that, surprisingly, Sql Prompt works fine when you eliminate all expressions from the SELECT clause in the subquery (inlcuding '*'), as in the following query, which is of course no longer valid:
SELECT (
SELECT TOP 1
FROM Table2 AS t2
WHERE t2.
) as val
FROM Table1 AS t1
Thanks,
Brian
SELECT (
SELECT TOP 1 Col1
FROM Table2 AS t2
WHERE t2.
) as val
FROM Table1 AS t1
In the query above, typing the '.' after WHERE t2 does not get any response from Sql Prompt. If you press CTL-SPC, it only suggests columns for t1. Same thing happens if you try to get candidates by doing a JOIN within the subquery.
My query is much more complex than this example, but I pared it down to demonstrate the problem.
Note that, surprisingly, Sql Prompt works fine when you eliminate all expressions from the SELECT clause in the subquery (inlcuding '*'), as in the following query, which is of course no longer valid:
SELECT (
SELECT TOP 1
FROM Table2 AS t2
WHERE t2.
) as val
FROM Table1 AS t1
Thanks,
Brian
Using Sql Prompt 3.7 with SQL Server 2000, Query Analyzer, and 2005 Mgmt Studio.
Comments
In Example 2 you get no suggestions from Sql Prompt when referencing Table1 in the main query.
So, it appears that in Example 1, there are no suggestions for the subquery, while in Example 2, there are none for the main query.
Strange! I have tried this and it doesn’t work for me either. It looks like the parser is having trouble identifying the object for the query. We will have a look at this and fix it for the next release version.
Thank you very much for bringing this up and excuse us for any inconvenience.
Regards,
Tanya