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

suggestions wrong on temp #table

results from table1,table2 into #table

results from here into #table2

select from #table2 t2

t2.<prompt>

is showing values from the very first query (table2)
austrianfoodispuke
0

Comments

1 comment

  • Ben Pinchen
    I've tried this out and, correct me if I've got anything wrong, here's what I did using the Adventureworks database:

    SELECT * INTO #table1
    FROM Person.Address
    JOIN Sales.CustomerAddress ON Person.Address.AddressID = Sales.CustomerAddress.AddressID

    SELECT * INTO #table2
    FROM #table1

    SELECT * FROM #table2 t2
    WHERE t2.<prompt>

    This then showed me the column options from merging table1 and table2 (Person.Address and Sales.CustomerAddress). Which is what I'd expect. It didn't just prompt with the columns from table2 (Sales.CustomerAddress). As I say, let me know if I've misunderstood you.
    Ben Pinchen
    0

Add comment

Please sign in to leave a comment.