SELECT MAX(RIGHT(RTRIM(CustAddrID), 5)) AS CustAddrID FROM tarCustAddr WHERE (CustKey = 114) AND (LEFT(CustAddrID, 4) = 'ADR_') AND (isnumeric(RIGHT(RTRIM(CustAddrID), 5)) = 1)When I execute it in Enterprise Mgr, I get back a record containing the value 00001 - but when I execute it through SPT, I get a single NULL record in the resulting cursor! I've traced it through SQL Profiler to make sure the command is sent through untouched and it is indeed sent to SQL server exactly as I defined.