September 8, 2011 at 4:45 am
Hi,
I have a table where the columns are set to Polish collation (in order to store Polish characters such as ą ć ę ł ń ó ś ź ż).
I have a 2nd table where the columns are set to the server default collation (SQL_Latin1_General_CP1_CI_AS).
The table definitions are exactly the same. All columns are set to char (rather than nchar).
When I insert into table2 select * from table 1, I notice that the Polish characters are 'translated' into standard english characters.
e.g 'ą' becomes 'a', 'ć' becomes 'c' etc.
This is good as my application isn't configured to handle unicode characters.
I'm just wondering exactly what is happening during the insert? Is SQL Server looking up the equivalent for these characters in the standard codepage?
Can I rely on this behaviour to be consistent every time?
thanks for any info.
Phil.
September 8, 2011 at 6:19 am
make sure all your columns are NVARCHAR, and not VARCHAR....that should resolve the conversion issue, i think.
collation only decides how the strigns are sorted and ordered by...it does not decide what strings can or cannot be saved.
here's a sample of what you are doing...high ascii needs nvarchar:
DECLARE @myString varchar(30)
SET @myString = N'ac'
select @myString --returns 'ac'!
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply