Data Translation Driver
Character Translation. Applications and data sources often contain data stored in different character formats. The BASIS ODBC Driver provides the capability to define an ODBC translator and code page to reconcile the character formats, and recommends using the Microsoft Code Page Translator for this task, as follows. Customize your translation. Customize Microsoft Translator’s advanced neural machine translation when translating text or speech with Custom Translator.
-->Alfatron spa driver download for windows 10. Applies to:
Character data, such as ANSI character variables declared with SQL_C_CHAR or data stored in SQL Server using the char, varchar, or text data types, can represent only a limited number of characters. Character data stored using one byte per character can only represent 256 characters. The values stored in SQL_C_CHAR variables are interpreted using the ANSI code page (ACP) of the client computer. The values stored using char, varchar, or text data types on the server are evaluated using the ACP of the server.
If both the server and the client have the same ACP, then they have no problems in interpreting the values stored in SQL_C_CHAR, char, varchar, or text objects. If the server and client have different ACPs, then SQL_C_CHAR data from the client may be interpreted as a different character on the server if it is used in char, varchar, or text columns, variables, or parameters. For example, a character byte containing the value 0xA5 is interpreted as the character Ñ on a computer using code page 437 and is interpreted as the yen sign (¥) on a computer running code page 1252.
Unicode data is stored using two bytes per character. All extended characters are covered by the Unicode specification, so all Unicode characters are interpreted the same by all computers.
The AutoTranslate feature of the SQL Server Native Client ODBC driver attempts to minimize the problems in moving character data between a client and a server that have different code pages. AutoTranslate can be set in the connect string of SQLDriverConnect, in the configuration string of SQLConfigDataSource, or when configuring data sources for the SQL Server Native Client ODBC driver using ODBC Administrator.
When AutoTranslate is set to 'no', no conversions are done on data moved between SQL_C_CHAR variables on the client and char, varchar, or text columns, variables, or parameters in a SQL Server database. The bit patterns may be interpreted differently on the client and server computers if the data contains extended characters and the two computers have different code pages. The data will be interpreted the same if both computers have the same code page.
When AutoTranslate is set to 'yes', the SQL Server Native Client ODBC driver uses Unicode to convert data moved between SQL_C_CHAR variables on the client and char, varchar, or text columns, variables, or parameters in a SQL Server database:
When data is sent from an SQL_C_CHAR variable on the client to a char, varchar, or text column, variable, or parameter in an SQL Server database, the ODBC driver first converts from SQL_C_CHAR to Unicode using the ACP of the client, then from Unicode back to character using the ACP of the server.
When data is sent from a char, varchar, or text column, variable, or parameter in a SQL Server database to a SQL_C_CHAR variable on the client, the SQL Server Native Client ODBC driver first converts from character to Unicode using the ACP of the server, then from Unicode back to SQL_C_CHAR using the ACP of the client.
Because all of these conversions are done by the SQL Server Native Client ODBC driver executing on the client, the server ACP must be one of the code pages installed on the client computer.
Making the character conversions through Unicode ensures the proper conversion of all characters that exist in both code pages. If a character exists in one code page but not another, however, then the character cannot be represented in the target code page. For example, code page 1252 has the registered trademark symbol (®), while code page 437 does not.
The AutoTranslate setting has no effect on these conversions:
Moving data between character SQL_C_CHAR client variables and Unicode nchar, nvarchar, or ntext columns, variables, or parameters in SQL Server databases.
Moving data between Unicode SQL_C_WCHAR client variables and character char, varchar, or text columns, variables, or parameters in SQL Server databases.
Data always must be converted when moved from character to Unicode.
See Also
Processing Results (ODBC)
Collation and Unicode Support
Symptoms
Consider the following scenario:
In Microsoft SQL Server 2005, you use SQL Server Management Studio to query character data from a SQL Server database that uses a non-Unicode data type. For example, the SQL Server database uses the char data type, the varchar data type, or the text data type.
The code page of the client computer differs from the code page of the database. The code page is associated with the collation of the database.
In this scenario, character data is represented incorrectly.
For example, you may experience one of the following problems:
The character data is represented as a question mark (?). You may see this problem if you inserted or updated the character data as a non-Unicode data type before you queried the character data. This problem occurs if you make this change by using SQL Server Management Studio on a client computer that has a different code page.
The character data is represented as corrupted data. The character data of code page X is stored in a non-Unicode column of code page Y. Additionally, the character data is not translated. This problem occurs when you query the character data by using SQL Server Management Studio.
Note When you query the character data by using SQL Query Analyzer in Microsoft SQL Server 2000, the character data is represented correctly if the
Perform translation for character data setting (the Auto Translate parameter) is disabled. The Auto Translate parameter is a parameter of the ConnectionString property for Microsoft OLE DB Provider for SQL Server and for Microsoft .NET Framework Data Provider for OLE DB.
Data Translation Software
Cause
This problem occurs because the character data of code page
X is stored in a non-Unicode column of code page
Y. Additionally, the character data is not translated correctly. We do not support storing the character data of code page
X in a column of code page
Y.
In SQL Server 2005, when you use a string literal of a non-Unicode data type, the string literal is converted by using the database's default code page that is derived from the database's collation. Storing the character data of code page X in a column of code page Y may cause data loss or data corruption.
If the character data is represented as corrupted data, the data can be represented correctly only if you disable the Auto Translate parameter for Microsoft OLE DB Provider for SQL Server or for Microsoft .NET Framework Data Provider for OLE DB.
Note SQL Server Management Studio uses Microsoft .NET Framework Data Provider for SQL Server to connect to the SQL Server database. This data provider does not support the Auto Translate parameter.
Workaround
To work around this problem, use one of the following methods.
Method 1: Use a Unicode data type instead of a non-Unicode data type
Change the columns to a Unicode data type to avoid all the problems that are caused by code page translation. For example, use the nchar data type, the nvarchar data type, or the ntext data type.
For more information about storing Unicode data, click the following article number to view the article in the Microsoft Knowledge Base:
239530 You must precede all Unicode strings with a prefix N when you deal with Unicode string constants in SQL Server
Method 2: Use an appropriate collation for the database
If you must use a non-Unicode data type, always make sure that the code page of the database and the code page of any non-Unicode columns can store the non-Unicode data correctly. For example, if you want to store code page 949 (Korean) character data, use a Korean collation for the database. For example, use the Korean_Wansung_CI_AS collation for the database.
Method 3: Use the binary data type or the varbinary data type
If you want the database to directly store and retrieve the exact byte values of the characters that are handled without trying to perform appropriate code page translation, use the binary data type or the varbinary data type.
Method 4: Use a different tool to store and retrieve data, and disable the Auto Translate parameter
Warning We do not test or support storing the character data of code page
X in a column of code page
Y. This operation may cause linguistically incorrect query results, incorrect string matching or ordering, and unexpected code page translation (data corruption). We encourage you to use one of the other methods to work around this problem.
When you use Microsoft OLE DB Provider for SQL Server to connect to a database that has a different code page and you try to query character data from a non-Unicode data type column, you must make sure that you store the untranslated characters to the database.
Note The following example assumes that the code page of the client computer is Korean (CP949) and that the code page of the SQL Server database is English (CP1252). You must replace the placeholders in the code examples with values that are appropriate for your situation.
To work around this problem, follow these steps:
Manually convert the characters to raw data, and then insert the data into the database by using the code page of the database. To do this, use code that is similar to the following code example.
Note This code example is written in C#.
When you want to query the data, use Microsoft OLE DB Provider for SQL Server or Microsoft .NET Framework Data Provider for SQL Server to connect to the database, and then set the Auto Translate parameter to False. To do this, use code that is similar to the following code example.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the 'Applies to' section.
More Information
Steps to reproduce the problem
Data Translation Driver Test
On the client computer that has Korean (CP949) as the default code page, start SQL Server Management Studio.
Connect to a database that has English (CP1252) as the default code page.
Create a table in the database by using the following line of code.
Insert a Korean character to the database by using the following query.
Create a select query to retrieve the data by using the following line of code.
You receive the following results. The value in column A is a question mark.
References
For more information about the SQL Server collation and the Auto Translate parameter, click the following article numbers to view the articles in the Microsoft Knowledge Base:
162367 How to transfer Korean Double Byte Character Set chars
234748 You cannot correctly translate character data from a client to a server by using the SQL Server ODBC driver if the client code page differs from the server code page
For more information about SQL Server Unicode data types, visit the following Microsoft Developer Network (MSDN) Web site: