I need to select a bunch of data into a temp table to then do some secondary calculations; To help make it work more efficiently, I would like to have an IDENTITY column on that table. I know I could declare the table first with an identity, then insert the rest of the data into it, but is there a way to do it in 1 step?
Sql – INSERT INTO a temp table, and have an IDENTITY field created, without first declaring the temp table
sqlsql server
Related Topic
- SQLite – UPSERT *not* INSERT or REPLACE
- Sql – Insert results of a stored procedure into a temporary table
- Sql – Select n random rows from SQL Server table
- Sql-server – the best way to auto-generate INSERT statements for a SQL Server table
- Sql – When should I use CROSS APPLY over INNER JOIN
- Sql – What are the options for storing hierarchical data in a relational database
- Mysql – Insert into a MySQL table or update if exists
- Sql – Insert Data Into Temp Table with Query
Best Answer
Oh ye of little faith:
http://msdn.microsoft.com/en-us/library/aa933208(SQL.80).aspx