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
How does SSIS(Sql Server Integration Services) deffer from DTS(Data Transformation Services)?
How to skip remaining statements in a loop block using continue statements?
Is sql server a database?
How do you drop an index?
What is a mixed extent?
What is the report builder?
What is normalization and its types?
What is the preferred way to create a clustered and non-clustered index? Which index should you create first the clustered or non-clustered?
What are the underflow and overflow behaviors on float literals?
Is sql server 2016 free?
How to create a trigger for insert only?
What is the purpose of the master database?
Why people hate cursor?
What stored by the msdb? : sql server database administration
What is database dimension? : sql server analysis services, ssas