[This topic is migrated from our old forums. The original author name has been removed]
There seems to be a bug in autocomplete when editing SQL Server SQL (I've not yet tried other SQL variants).
Consider the following SQL
bq. +declare @myvar varchar(10) = 'testing'+ \\ + select * from mytable where mycolumn = @myvar+
Autocomplete for mytable works fine but autocomplete for mycolumn fails to show anythign in the list.
This issue seems to occur whenever declaring variables at the top of a script. It prevents columns from being looked up correctly even if an explicit table alias is used.
It can be bypassed by plaving a semicolon between the variable declarations and the main SQL query though that's not a great workaround as you need to remove the semicolon again before execution or the variables will be out of scope.
Another minor omission from autocomplete is support for table names of the following format:
bq. +select * from mydatabase..mytable+
Even if mydatabase is set as the current database for the query, mytable will not show up in autocomplete. Change mydatabase.. to mydatabase.dbo. and all works as expected.
about 7 years ago
[This reply is migrated from our old forums.]
Re: Autocomplete bugs
What you describe is syntax that is specific to SQL Server (and maybe Sybase). The auto-completion feature currently supports mostly simple ANSII SQL and does not work well when combined with procedural code etc. that different databases may support.
We may add support for more database-specific syntax in the future so I will record your comments in our ticket system, but given how many other feature requests we have on our todo list, I doubt we will get to this any time soon.