Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
venkath
Posting Yak Master
202 Posts |
Posted - 2009-02-09 : 12:01:19
|
Hi AllI would like to know which is quicker between INSERT and UPDATE statements Thanks in advance. |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-09 : 12:39:52
|
Its like asking Which is Faster : BMW or Mercedes? |
 |
|
saurabhsrivastava
Posting Yak Master
216 Posts |
Posted - 2009-02-09 : 16:30:09
|
There is no generic answer to your question. I would suggest to test it in ur enviornment and find out answer for urself. |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-02-09 : 16:56:58
|
Because you cannot UPDATE before the data was INSERTed your question comes strangely.But maybe your real question goes deeper?In other (older) systems we often have deleted our data and then inserted instead of making lots of updates.This was real faster. But in SQL Server I don't think so (for example just think about relationships...).But like saurabhsrivastava already posted: have your test!Webfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
revdnrdy
Posting Yak Master
220 Posts |
Posted - 2009-02-09 : 17:00:23
|
quote: Originally posted by sodeep Its like asking Which is Faster : BMW or Mercedes?
BMW is faster r&r |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-10 : 01:11:37
|
If you have no index at all on your table, an INSERT will be faster than UPDATE.An UPDATE needs to scan the whole table to get the records to update.An INSERT just adds data. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|