Error in collate SQL_Latin1_General_CP850_BIN2 with UTF-8 SQL Server - sql

I'm trying to select a column from my database that has SAP's informations.
But when I execute my select all my special characters as 'À Ê' are broken, for example:
TELECOMUNICAÃiES (INCLUI ASSIST-NCIA T+CNICA)
should be
TELECOMUNICAÇÕES (INCLUI ASSISTÊNCIA TÉCNICA)
Is there some way to resolve this using a cast or a convert functions?
OBS: All my tables are configured with SQL_Latin1_General_CP850_BIN2 as required of SAP, but the columns are varchar instead of nvarchar

Probably the data is corrupted because this collation is default in any Windows

Related

[Excel Destination [28]] Error: An error occurred while setting up a binding for the column. The binding status was "DT_NTEXT"

I'm working on ssis package which exports data from SQL Server to Excel. I had a problem converting non-unicode to unicode string data types. So I created a derived Column task and converted to Unicode string [DT_WSTR] 4 columns which have a type Varchar(40) in SQL Server table. It worked with these columns. But I also have a Description column of type varchar(max) and I tried to convert it to Unicode text stream [DT_NTEXT]. It did not work.
If your source is SQL Server (as you said), you can convert it directly in your SQL Query
SELECT
CONVERT(NVARCHAR(40), 'att1')
,CONVERT(NTEXT, 'att2')
Convert your VARCHAR into NVARCHAR
Convert your TEXT into NTEXT
it's faster.
P.S. To test it (Do not forget to delete or reset your previous OLE DB Input component) -> It will be forced to reevaluate your datatype
Does it help you?
The only thing that worked was to cast a Description column in Stored Procedure as varchar(1000). I checked the max length of this field and it was about 300 characters. So I made it varchar(1000) and in Derived column Unicode string [DT_WSTR]. This was a workaround, but I still want to know how to make it in ssis package without converting data type in Stored Procedure.

Hibernate MSSQL nvarchar Equivalent datatype in oracle [duplicate]

This question already exists:
nvarchar in sql ,oracle and mysql in Hibernate annotation mapping
Closed 8 years ago.
We are developed project using hibernate with sql server. Now we are migrating sql server to oracle.
We have user Nvarchar datatype in mssql server for more than 80 tables. While we are trying to create tables in oracle through hibernate table containing Nvarchar datatype are not getting generated other table are creating successfully.
While we change the column to varchar than also table are getting generated.
How to create UTF-8 datatype in oracle and mssql as a common datatype in hibernate.
Please Help !!!!!!
What is your database character set? Assuming that you create the database setting the database character set to AL32UTF8, VARCHAR2 columns in Oracle would store data in the UTF-8 character set.
If you cannot use a Unicode character set for your database character set, you'd need to use nvarchar2 columns. An nvarchar2 column stores data using the national character set. Unless you've upgraded from an old version of Oracle, your database character set would use the UTF-16 character set, not UTF-8.

which data type can save bangla Language in sql server?

I want to save bangla Language in sql server. Using which data type I can Do it in sql server 2005 or sql server 2008.
I tried varchar and varbinary type but it cannot save bangla Language.
How is it possible?
You're using SQL_Latin1_General_CP1_CI_AS for your collation, which is suited for the Latin character set (ISO-8859-1). To store characters fromother character sets, you can use the NVARCHAR() which can store the full Unicode range, irrespective of collation - this does mean it will need to be treated as NVARCHAR() all the way, as quoted constants (e.g. N'বাংলা Bangla'), as the data types for parameters to stored procedures, etc.

Date stored as a string in sql server when upsized from access 2007

When I upsize from Access2007 to SQL Server 2008, I have few issues...
1. text to nvarchar(255)
fields with text data type in Access are automatically converted to nvarchar(255)(I have unicode data) in sql server, but in reality the column-length is not that big so can I change the data type to nvarchar(55) or varchar(100)? Will there be any problem?
2. Date stored as text
Some tables throwed an error when tried to upsize because of the date column(mm/dd/yyyy), what I did is I changed the date/time column data type to text datatype in access, then the upsizing was successful, it converted to nvarchar(255) in sql server. I have converted nvarchar data type to date data type in sql server, but that does not show me a calendar symbol in access front-end. How to get a calendar symbol in the date field in my access front end?
I have tried the solution given in this link, but it did not work... Please give me some suggestions
text in sql server is deprecated, use nvarchar if you need to store unicode (multi lang support). Otherwise you can use varchar.

Read SQL Server field text value in Delphi XE with simultaneously character conversion

I have a SQL Server 2005 database with COLLATION SQL_Latin_General_CP1_CI_AS and I want to run a query from Delphi XE via ADO. Data in SQL Server is Greek and Latin characters. But in Delphi I get unreadable character strings. How can I manage this problem with Delphi XE ?
Since you say that you have both Greek and Latin characters in the db I guess that you are already using nvarchar in the db.
In Delphi you should then use TWideStringField for nvarchar fields. TStringField is for varchar (ansistring).
Field1 contains "γειά σου"
StringField := ADODataSet1.FieldByName('Field1') as TStringField;
ShowMessage(StringField.Value);
ShowMessage shows "?e??s??"
This works fine
WideStringField := ADODataSet1.FieldByName('Field1') as TWideStringField;
ShowMessage(WideStringField.Value);
Edit 1
If you have varchar fields in db you should use TStringField and you need to make sure that the "Language for non-Unicode programs" is Greek(Greece).
"Control Panel - Region and Language - Administrative - Change system locale..."
I have found that sometimes UTF-8 is stored in databases in VarChar fields, usually from Java programs.
If you see things like â€", there's a good chance that's what is going on.
You could try
// Delphi 2009+
UTF8ToUnicodeString(RawByteString( db_value ))
// Delphi 2007 and older
UTF8Decode( db_value )
If this is the case, you can also use a sql function to convert the VarChar fields to NVarChar