Within SQL, there is no requirement that an OR clause breaks early. In other words, it is up to the optimizer whether to check both conditions simutaneously. I am not an expert in the MSSQL optimizer, but I have seen instances where the optimizer has and has not short circuited an OR clause.
Related Contents:
- How can I remove duplicate rows?
- How do I generate a random number for each row in a T-SQL select?
- Pad a string with leading zeros so it’s 3 characters long in SQL Server 2008
- How do I create a unique constraint that also allows nulls?
- Does T-SQL have an aggregate function to concatenate strings? [duplicate]
- LEFT JOIN vs. LEFT OUTER JOIN in SQL Server
- Calculate running total / running balance
- Pass Dictionary to Stored Procedure T-SQL
- How to change identity column values programmatically?
- Escape a string in SQL Server so that it is safe to use in LIKE expression
- Using a if condition in an insert SQL Server
- How to drop a table if it exists?
- Maximum size of a varchar(max) variable
- Insert Update trigger how to determine if insert or update
- How to set a default value for an existing column
- What is the best way to truncate a date in SQL Server?
- Dynamic SQL (passing table name as parameter)
- SQL – The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
- Replace duplicate spaces with a single space in T-SQL
- Is there a way to loop through a table variable in TSQL without using a cursor?
- How do you truncate all tables in a database using TSQL?
- INSERT INTO vs SELECT INTO
- SQL Server 2008 Empty String vs. Space
- Understanding SQL Server LOCKS on SELECT queries
- Preserving ORDER BY in SELECT INTO
- Select / Insert version of an Upsert: is there a design pattern for high concurrency?
- SQL Server: combining multiple rows into one row
- How to convert datetime in Persian in SQL Server
- SQL Server variable columns name?
- How do I find a stored procedure containing ?
- What is the Oracle equivalent of SQL Server’s IsNull() function?
- Return all possible combinations of values on columns in SQL
- How to check if a database exists in SQL Server?
- Dynamic SQL results into temp table in SQL Stored procedure
- SQL Server error on update command – “A severe error occurred on the current command”
- Recursive sum in tree structure
- Getting week number off a date in MS SQL Server 2005?
- How to split string and insert values into table in SQL Server
- Check if a string contains a substring in SQL Server 2005, using a stored procedure
- SQL Server Output Clause into a scalar variable
- INSERT INTO @TABLE EXEC @query with SQL Server 2000
- Sequence as default value for a column
- Joining multiple tables returns NULL value
- SQL server schema and default schema
- Ampersand (&) operator in a SQL Server WHERE Clause
- How do I select last 5 rows in a table without sorting?
- How to calculate difference in hours (decimal) between two dates in SQL Server?
- How to use RANK() in SQL Server
- How can I insert binary file data into a binary SQL field using a simple insert statement?
- How to check SQL Server Database compatibility after sp_dbcmptlevel is deprecated?