it looks like you are trying to replace NULL values with an empty string. To correct the syntax, you can use the COALESCE
function instead of ISNULL
since COALESCE
can handle more than two arguments. Here's an updated version of your code:
TRY_CAST(REPLACE(COALESCE(NULLIF(SUBSTRING(event_id, PATINDEX('%[0-9]%', event_id), 1), '0'), ''), '[^0-9]', '') AS INT) * 10
This eliminates the use of ISNULL
and instead uses COALESCE
for handling NULL values, keeping the expression concise.
If this helps kindly accept the answer thanks much.