SQL Server (2005/2008)
Each of the below statements have the same result. Does anyone know if one outperforms the other?
insert into SOMETABLE values ('FieldOneValue','FieldTwoValue',3,4.55,'10/10/2008 16:42:00.000') insert into SOMETABLE select 'FieldOneValue','FieldTwoValue',3,4.55,'10/10/2008 16:42:00.000' insert into SOMETALBE Select Field1 = 'FieldOneValue', Field2 = 'FieldTwoValue', Field3 = 3, Field4 = 4.55, Field5 = '10/10/2008 16:42:00.000'
Assuming of course that the data types match the table appropriately…
I just tested this.
5 million iterations of both approaches on two sets of hardware, one a server with 16GB RAM, one a notebook with 1GB.
Result: They appear to be the same.
The query plans for these are the same, and the performance differential is statistically insignificant.