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 |
|
msrs
32 Posts |
Posted - 2007-12-06 : 01:36:11
|
| Dear all, i am trying to improve the performance of stored procedures and functions in that in key word is there i have to replace with exists.which one will give better performance.Thanks&Regards,Msrs |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-06 : 03:24:45
|
Most often exists will perform better. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2007-12-06 : 17:59:14
|
| They behave differently around NULLs so it is not necessarily a search & replace operation. You should check each query. Consider:select * from (select '1' a union select '2' union select '3' union select null ) t1where exists (select a from(select '1' a union select '2' union select '3' union select null) t2 )vsselect * from (select '1' a union select '2' union select '3' union select null ) t1where a in (select a from(select '1' a union select '2' union select '3' union select null) t2 ) |
 |
|
|
|
|
|