This covers short-circuat evaluation in SQL-Server deeply:
http://www.sqlservercentral.com/articles/T-SQL/71950/
In short: the evaluation order depends on the query optimizer.
Edit: As Martin commented this does not guarantee the order since it could also be optimized. From the above link(i should have read it completely):
When run against a SQL Server 2000, no error is thrown, but SQL Server
2005 and 2008 implement an optimization to push non-SARGable
predicates into the index scan from the subquery which causes the
statement to fail.
To avoid this issue, the query can be rewritten incorporating a CASE
expression, maybe a bit obscure, but guaranteed not to fail.
So this should guarantee that ISNUMERIC
will be evaluated first:
SELECT aData.*,bData.*
FROM #TableA aData INNER JOIN #TableB bData
ON aData.id = CASE ISNUMERIC(bData.col1) WHEN 1 THEN CAST(bData.col1 AS INT) END
Ignore my first approach(which might not work everytime):
You should modify your join to ensure that is gets evaluated correctly:
SELECT aData.*,bData.*
FROM #TableA aData INNER JOIN
(
SELECT col1
FROM #TableB b
WHERE ISNUMERIC(b.col1) = 1
) AS bData
ON aData.id = CAST(bData.Col1 AS int)
Sample data:
create table #TableA(id int)
create table #TableB(col1 varchar(10))
insert into #TableA values(1);
insert into #TableA values(2);
insert into #TableA values(3);
insert into #TableA values(4);
insert into #TableB values('1');
insert into #TableB values('2');
insert into #TableB values(null);
insert into #TableB values('4abc');
SELECT aData.*,bData.*
FROM #TableA aData INNER JOIN
(
SELECT col1
FROM #TableB b
WHERE ISNUMERIC(b.col1) = 1
) AS bData
ON aData.id = CAST(bData.Col1 AS int)
drop table #TableA;
drop table #TableB;
Result:
id col1
1 1
2 2