T-SQL Constant Time Comparison
The general approach is sound, but the xor-ing is unnecessarily complex and actually causes it to give an incorrect answer in some cases.  If I've worked through it correctly, it will report that the empty string is equal to the string with the single byte 1.  The simple approach would be to just increment @result when the strings differ at position @i.

There's another concern that I'm not qualified to comment on for T-SQL, but that I know applies to C# or C++: the algorithm that you've specified should be constant-time, but that is before it gets run through any compilers or optimizers.  If you switch to an algorithm that increments a counter, it's conceivable that an optimizer would realize that once @result is not zero the return value is 1, defeating your efforts.