Is there a way to define a temp table without defining it's schema up front?
相关问题
- sql execution latency when assign to a variable
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
- SQL to Parse a Key-Value String
相关文章
- Entity Framework 4.3.1 failing to create (/open) a
- How to truncate seconds in TSQL?
- Code for inserting data into SQL Server database u
- Delete Every Alternate Row in SQL
- Linux based PHP install connecting to MsSQL Server
- SQL Azure Reset autoincrement
- How do we alias a Sql Server instance name used in
- Is recursion good in SQL Server?
Yes, you can create it with
Let's say
you don't need OPENQUERY. Just put "INTO #AnyTableName" between the select list and the FROM of any query...
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.