I\'m stuck on the following scenario. I have a database with a table with customer data and a table where I put records for monitoring what is happening on our B2B site.
Use
TRY_CONVERT(UNIQUEIDENTIFIER, parameter2) AS customerguid
instead of
CONVERT(UNIQUEIDENTIFIER, parameter2) AS customerguid
Views are inlined into the query and the CONVERT can run before the WHERE.
CONVERT
WHERE
For some additional discussion see SQL Server should not raise illogical errors