... new DB that has to be in a different collation (Y Collation) thatthan the SQL Server Instance default collation (X Collation).
What comes toabout SQL Server textstring functions Replace:
REPLACE
, SubstringSUBSTRING
, etc. They will be? Will they always be returned in X collation?
FunctionsBuilt-in functions usually return a string in the database's default collation, unless you pass in a column or an expression using the COLLATE
clause.
do you see any potential data loss or maybe any different problems?
- Instance-level collation controls:
- variable name / cursor name /
GOTO
label resolution. It won't matter what the database-level collation is. - instance-level metadata: login names, server names, server role names, server-level objects, database names, etc.
- default collation for:
- newly created databases (unless the
CREATE DATABASE
statement included theCOLLATE
clause) tempdb
metadata (names of temp object / constraints / indexes / defaults / permanent tables / etc)- columns in temp tables and permanent tables in
tempdb
- newly created databases (unless the
- variable name / cursor name /
- Database-level collation controls:
- database-level metadata: user names, schema names, database role names, schema-bound object names, etc.
- default collation for:
- columns in table variables, permanent tables, TVF results
- string literals
- string variables (the contents of the variable, not the name)
- return value of scalar UDFs