In what direction SQL Server WHERE clause conditions are checked? I have this query:

SELECT RCodeID as 'ListItemID',
       RCode as 'ListItemName' 
FROM RCode    
WHERE RCode not like '%,%' 
      AND ISNUMERIC(RCode) = 1 
      AND CAST(RCode as int) &gt;= CAST(@From as int) 
      AND CAST(RCode as int) &lt;= CAST(@To as int)
ORDER BY ListItemName;


So in what order (Right to left/left to right), these conditions are checked by the SQL Server?

Because I am getting those rows which have a , comma too, but I want to exclude them before ISNUMERIC(Rcode) is executed.

Data in the table:

+---------+--------+
| RCodeID | RCode  |
+---------+--------+
| 1       | 342    |
+---------+--------+
| 2       | 232,23 |
+---------+--------+
| 3       | 323xs  |
+---------+--------+


Input: @From=300 and @To=400

Expected Output:

+---------+--------+
| RCodeID | RCode  |
+---------+--------+
| 1       | 342    |
+---------+--------+


UPDATE

I moved the code with RCode not like '%,%' AND ISNUMERIC(RCode) = 1 in a view. The view is showing the correct data. But when I use that view in above query, the cast error for comma-seperated values is coming. If view is filtering that data then why those rows are coming?
I don't think there are any guarantees for evaluation order. The optimizer will try to find the most efficient way to execute the query using available information and each invocation of the query may change depending on what the optimizer thinks is the best plan right now.

If you MUST exclude some rows before evaluating other rows, I think you'll have to materialize the first result set (possibly in a temp table) and then run additional queries against that materialized result set.

To get around your CASTing error, you could use TRY_CAST

DROP TABLE IF EXISTS Table1
GO
CREATE TABLE Table1 (
    RcodeID INT
    ,RCode VARCHAR(6)
    );

INSERT INTO Table1 (RcodeID,RCode)
VALUES (1,'342'),(2,'232,23'),(3,'323xs');

DECLARE @FROM INT = 300
DECLARE @TO INT = 400

SELECT RCodeID AS 'ListItemID'
    ,RCode AS 'ListItemName'
FROM table1
WHERE RCode NOT LIKE '%,%'
    AND ISNUMERIC(RCode) = 1
    AND TRY_CAST(RCode as INT) &gt;= CAST(@From AS INT)
    AND TRY_CAST(RCode as INT) &lt;= CAST(@To AS INT)
ORDER BY ListItemName;




| ListItemID | ListItemName |
|------------|--------------|
| 1          | 342          |