OMG! What am I doing wrong?
declare @WTF TABLE (
OrderItemId int
)
SELECT TOP 20 OrderItemId as OrderItemId INTO [@WTF] FROM ac_OrderItems
SELECT * FROM [@WTF]
Problem A: This creates a PHYSICAL table called @WTF. WHY?? I thought this was in memory only?!
Problem B: The last line of code, if I do select * from @WTF... WITHOUT the [ ], it returns NOTHING. What is the significance of the [ ]?
I need serious help. I'm losing my MIND!
Thanks in advance.