Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server
In the .NET Framework, the CompareInfo object handles collations. The .NET Framework string application programming interfaces (APIs) use the CompareInfo property associated with the CultureInfo object of the current thread to perform string comparisons. The default setting of the CultureInfo object is based on the Windows locale setting for the computer on which SQL Server is running. This determines the default comparison semantics, if no explicit CultureInfo is specified, for comparisons of System.String values. SQL Server doesn't explicitly change the CompareInfo property to the database or server collation. If necessary, you must set the appropriate CompareInfo property in your routines.
Parameter collation
When you create a common language runtime (CLR) routine, and a parameter of a CLR method bound to the routine is of type SQLString, SQL Server creates an instance of the parameter with the default collation of the database containing the calling routine. If a parameter isn't a SqlType (for example, String rather than SQLString), the collation information from the database isn't associated with the parameter.