SqlPrompt doesn't understand the Syntax of an update-statement when the table-to-be-updated is aliased
Hi!
Please consider this statement
update t1
set t1.value = t2.value
from Table1 t1
join Table2 t2
on t1.ID = t2.ID
When you have the cursor in the set-block of the statement, SqlPrompt doesn't know what 't1' means and which columns t1 has.
This is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Aaron Bauman commented
To clarify a bit: if you type in "t1." you do not get a list of the columns.
However if you leave off the "t1" and just hit [space] after "SET" it will give you a list of the appropriate columns.
I think it should give you the list of columns when hitting "t1" -
Nicholas Orlando commented
Seems to work just fine for me. Only time it doesn't work is when there is a syntax error earlier in the query or if the table being updated is a temp table and SQL Prompt can figure out the definition of the table. EX: SELECT * INTO #MyTempTable FROM MyTable