How can we help you today? How can we help you today?

Format bug for temp table alias

Using SQL Prompt v9.3.0.6627, try formatting this and you'll see that Format drops the reference #my_tb on the JOIN clause, leaving the column as ambiguous and thereby fails SQL parsing:

CREATE TABLE #my_tb (database_id int)

INSERT INTO #my_tb  VALUES (1), (2), (3), (4)

SELECT * 
FROM #my_tb
JOIN sys.databases db ON db.database_id = #my_tb.database_id

The work-around is to provide an alias for #my_tb, but that shouldn't be necessary.
Thanks.

ByronBarton
0

Add comment

Please sign in to leave a comment.