Options

Expand * doesn't pickup all the columns from a Temp Table

BrienKingBrienKing Posts: 30 Bronze 3
edited August 27, 2019 5:06AM in SQL Prompt
If you have something like this:

SELECT
          [a].Field1,
          [a].Field2,
          [b].AnotherField1,
          [b].AnotherField2
INTO
          #TempTable
FROM
          TableA
          LEFT OUTER JOIN TableB ON TableA.Field1 = TableB.AnotherField1

Then you add:

SELECT
         tt.*
FROM 
        #TempTable tt

Then you put your cursor on the * and hit the Tab key you get:

SELECT
          [tt].Field1,
          [tt].Field2
FROM 
        #TempTable tt

None of the fields from Table B show up.

Answers

Sign In or Register to comment.