If the value of $arg2 is a zero-length string, the function returns True. If the value of $arg1 is a zero-length string and the value of $arg2 is not a zero-length string, the function returns False.
If the value of $arg1 or $arg2 is the empty sequence, the argument is treated as the zero-length string.
The contains() function uses XQuery's default Unicode code point collation for the string comparison.
The substring value specified for $arg2 has to be less than or equal to 4000 characters. If the value specified is greater than 4000 characters, a dynamic error condition occurs and the contains() function returns an empty sequence instead of a Boolean value of True or False. SQL Server does not raise dynamic errors on XQuery expressions.
In order to get case-insensitive comparisons, the upper-case or lower-case functions can be used.