If I was to perform this query, which would you expect to be faster in SQL Server 2008 with a table containing 100_000 records:
First version (with #temp table):
Second version (directly from the table):
I have conflicting opinions from people here and the times recorded (within SQL Server Management Studio and through C# code) fluctuate slightly showing them to be almost identical.
I would just like to know what the experts consider best practice here.
Thanks in advance,
Jake
"It doesn't do anything"
"Correction, it DOES nothing
First version (with #temp table):
SQL:
SELECT one
, two
, ...
, n
INTO #results
FROM table AS temp
SELECT convert(...one)
, convert(...two)
, convert(...)
, convert(...n)
FROM #results
Second version (directly from the table):
SQL:
SELECT convert(...one)
, convert(...two)
, convert(...)
, convert(...n)
FROM table
I have conflicting opinions from people here and the times recorded (within SQL Server Management Studio and through C# code) fluctuate slightly showing them to be almost identical.
I would just like to know what the experts consider best practice here.
Thanks in advance,
Jake
"It doesn't do anything"
"Correction, it DOES nothing