suggestions wrong on temp #table

austrianfoodispukeaustrianfoodispuke Posts: 100
edited August 21, 2008 3:16PM in SQL Prompt Previous Versions
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)

Comments

  • 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.
Sign In or Register to comment.