Is there a way to define a temp table without defining it’s schema up front?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Actually using a table VARIABLE, an in-memory table, is the optimal way to go. The #table creates a table in temp db, and ##table is global – both with disk hits. Consider the slow-down/hit experienced with the number of transactions.
Note the way you insert into this temp table.
The down-side of this is that it may take a bit longer to write, as you have to define your table variable.
I’d also recommend SQL Prompt for Query Analyzer by RedGate.