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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How SQL handles the OR part in the WHERE clause.

Author  Topic 

vijayans
Starting Member

1 Post

Posted - 2008-04-28 : 10:48:04
Hi,

I have a Query like this and i am using fulltext search.

Select * FROM [Search]
WHERE (@limitByName = 0 OR CONTAINS([Name], @searchStringOR))

Say @limitByName is 0, will my second part still executes.???
How Sql server 2005 handles the OR part in WHERE clause.(Need detailed answer)..pls give any useful link to refer.

How can i find this, if i use Actual Execution plan.

Thanks in Advance,
Vijay.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-28 : 11:04:16
http://weblogs.sqlteam.com/mladenp/archive/2008/02/25/How-SQL-Server-short-circuits-WHERE-condition-evaluation.aspx


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -