-
as seen on SQL Server Planet
- Search for 'SQL Server Planet'
If you landed on this article, then you most likely know that temp tables can cause recompilation. This happens because temp tables are treated just like regular tables by the SQL Server Engine. When the tables (in which underlying queries rely on) change significantly, SQL Server detects this change…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I'm getting the following error whenever my code creates a DataTableReader from a valid DataTable Object:
"DataTableReader is invalid for current DataTable 'TempTable'."
The thing is, if I reboot my machine, it works fine for an undertimed amount of time, then dies with the above. The code…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi All,
I am importing an intermediate result of query into a temp table for further use, so I used a #temp table to maintain the same schema as
select * into # temp from schema.tableName where 1<1;
insert into # temp from exec(table)
While I am doing this statement as a variable to pass the…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a client application that creates a temp table, the performs a bulk insert into the temp table, then executes some SQL using the table before deleting it.
Pseudo-code:
open connection
begin transaction
CREATE TABLE #Temp ([Id] AS int)
bulk insert 500 rows into #Temp
UPDATE [OtherTable] SET…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I need to create a temp table, than add a new int NOT NULL AUTO_INCREMENT field to it so I can use the new field as a row number. Whats wrong with my query?
SELECT post, newid FROM ((SELECT post`test_posts`) temp ALTER TABLE temp ADD COLUMN newid int NOT NULL AUTO_INCREMENT)
>>> More