Your problems resides on the fact that charindex returns NULL it either
search condition or searched string is NULL (since SQL 70).
So you have NULL value comapring to zero which gives UNKNOWN if SET
ANSI_NULL is ON. (tried with OFF but still got same result).
The problems with comapring NULL values is described in SQL BOL: NULL
Comparison Search Coditions.
Try this code snipet:
select tags = Inserted.Custom16 FROM inserted
IF not(CharIndex('<L',tags,1) > 0) or tags is null
select mycar = '<LL>'
<com> wrote in message