What is the difference between IN and EXISTS operators in
SQL Server?

Answer Posted / monal

HERE'S THE SIMPLE ANSWER:
WHEN YOU USE 'IN', WHILE CHECKING FOR WHERE CONDITION SQL
SERVER ENGINE DOES WHOLE TABLE SCAN.
IF YOU USE 'EXISTS' AS SOON AS ENGINE FINDS THE REQUIRED
ROW IT WILL STOP EXECUTING QUERY AND GOING FURTHER SCANNING
TABLE.

SO BASICALLY EXISTS IS FASTER AS COMPARED TO IN.

Is This Answer Correct ?    146 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the stuff?

535


How to filter out duplications in the returning rows in ms sql server?

652


how would you improve etl (extract, transform, load) throughput?

556


Explain system rowset functions?

573


What is the difference between writing data to mirrored drives versus raid5 drives

519






How to use go command in "sqlcmd"?

655


What is ddl and dml commands?

523


what exactly sql injuction.how to overcome.....

2053


Define right outer join in sql server joins?

530


Explain ranking functions?

625


what are user defined datatypes and when you should go for them? : Sql server database administration

558


what kind of lan types do you know? : Sql server database administration

529


What is the order by used for?

633


What is a mixed extent?

607


what is the Ticketing tool used in Wipro technologies at Bangalore...???

7490