Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Databases Programming Interviews:BtrieveClipperData ModelingData StructuresDatabase AdministrationDatabase Administrator (DBA)Database AnalystDatabase DeveloperDB DevelopmentEDI/Data Integration ExpertFirebirdHierarchicalIBM DB2InformixJava DatabaseMariaDBMicrosoft Access DeveloperMongoDBMS SQL ServerMySQL ProgrammingNetworkNoSQLObject RelationalPostgrePostgreSQLProgressRDBMSRelationalSQLSQL AdministratorSQL and PL/SQLSQL Notification ServicesSQL server 2008SSRSStored ProcedureSybaseTeradata
Copyright © 2018. All Rights Reserved
MS SQL Server Interview Question:
What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server?
Submitted by: AdministratorIn SQL Server, different collations may use different code pages. For example:
* Albanian_CI_AI_KS_WS - Albanian, Code page 1250.
* Arabic_CI_AS_KS_WS - Arabic, Code page 1256.
* French_CI_AI - French, Code page 1252.
* Korean_Wansung_BIN - Korean-Wansung, Code page 949.
* SQL_Latin1_General_CP1250_CI_AS - Latin1-General, Code page 1250.
If you are casting a string of characters from one code page to a different code page, some character will be converted to similar. For example
PRINT 'Fran?is: e??a?o?;
-- The default code page
PRINT 'Fran?is: e??a?o?
COLLATE French_CI_AI; -- Code page 1252
PRINT 'Fran?is: e??a?o?
COLLATE Polish_CI_AS; -- Code page 1250
PRINT 'Fran?is: e??a?o?
COLLATE Cyrillic_General_CI_AS; -- Code page 1256
GO
Fran?is: e??a?o?
Fran?is: e??a?o?
Fran?is: e?e-aa-o?
Francais: eeee-aa-oo
How find out the default Collation?
Submitted by: Administrator
* Albanian_CI_AI_KS_WS - Albanian, Code page 1250.
* Arabic_CI_AS_KS_WS - Arabic, Code page 1256.
* French_CI_AI - French, Code page 1252.
* Korean_Wansung_BIN - Korean-Wansung, Code page 949.
* SQL_Latin1_General_CP1250_CI_AS - Latin1-General, Code page 1250.
If you are casting a string of characters from one code page to a different code page, some character will be converted to similar. For example
PRINT 'Fran?is: e??a?o?;
-- The default code page
PRINT 'Fran?is: e??a?o?
COLLATE French_CI_AI; -- Code page 1252
PRINT 'Fran?is: e??a?o?
COLLATE Polish_CI_AS; -- Code page 1250
PRINT 'Fran?is: e??a?o?
COLLATE Cyrillic_General_CI_AS; -- Code page 1256
GO
Fran?is: e??a?o?
Fran?is: e??a?o?
Fran?is: e?e-aa-o?
Francais: eeee-aa-oo
How find out the default Collation?
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.