I\'ve found a solution for finding the position of an underscore with PATINDEX :
DECLARE @a VARCHAR(10) SET @a = \'37_21\' PRINT PATINDEX(\'%_%\', @a)
To match two underscores, each must be bracketed
'%[__]%' -- matches single _ with anything after '%[_][_]%' -- matches two consecutive _