Showing posts with label collations. Show all posts
Showing posts with label collations. Show all posts

Sunday, March 25, 2012

Collation Error

Hi All,
Iam facing a problem with sql collations.
Problem:
I have a sproc1 residing on DB1 Database which makes a call to sproc2
on DB2 database.
The out params from sproc2 are processed inside sproc1. And the sproc1
is erroring out.
DB1 - SQL_Latin1_General_CP1_CI_AS Collation
DB2 - Japanese_CI_AS_KS_WS Collation
sproc1 Code:
declare @.name varchar(50)
SELECT @.Cmd = @.Server+'.'+@.Database+'.dbo.SPROC2 '
EXEC @.cmd @.name OUT
Error:
Server: Msg 446, Level 16, State 9, Line 1
Cannot resolve collation conflict for equal to operation.
With Regards,
Anandyou ought change that collation in DB2 and put on as in DB1.
"Anand" wrote:

> Hi All,
> Iam facing a problem with sql collations.
> Problem:
> I have a sproc1 residing on DB1 Database which makes a call to sproc2
> on DB2 database.
> The out params from sproc2 are processed inside sproc1. And the sproc1
> is erroring out.
> DB1 - SQL_Latin1_General_CP1_CI_AS Collation
> DB2 - Japanese_CI_AS_KS_WS Collation
> sproc1 Code:
> declare @.name varchar(50)
> SELECT @.Cmd = @.Server+'.'+@.Database+'.dbo.SPROC2 '
> EXEC @.cmd @.name OUT
> Error:
> Server: Msg 446, Level 16, State 9, Line 1
> Cannot resolve collation conflict for equal to operation.
> With Regards,
> Anand|||Can you post sproc2's code?
See "collate" clause in BOL.
AMB
"Anand" wrote:

> Hi All,
> Iam facing a problem with sql collations.
> Problem:
> I have a sproc1 residing on DB1 Database which makes a call to sproc2
> on DB2 database.
> The out params from sproc2 are processed inside sproc1. And the sproc1
> is erroring out.
> DB1 - SQL_Latin1_General_CP1_CI_AS Collation
> DB2 - Japanese_CI_AS_KS_WS Collation
> sproc1 Code:
> declare @.name varchar(50)
> SELECT @.Cmd = @.Server+'.'+@.Database+'.dbo.SPROC2 '
> EXEC @.cmd @.name OUT
> Error:
> Server: Msg 446, Level 16, State 9, Line 1
> Cannot resolve collation conflict for equal to operation.
> With Regards,
> Anand|||Both the databases resides in different servers.
As the collation is mandatory in both the databases we cannot change the
collation on both DB1 or DB2.
Is there any options without changing the collations?
"Enric" wrote:
> you ought change that collation in DB2 and put on as in DB1.
> "Anand" wrote:
>|||To change the collation at table/field level it could work, i don't know but
in any case, we would need see that sp.
Thanks and regards,
"Anand" wrote:
> Both the databases resides in different servers.
> As the collation is mandatory in both the databases we cannot change the
> collation on both DB1 or DB2.
> Is there any options without changing the collations?
> "Enric" wrote:
>|||sproc2:
create procedure sproc2
@.name varchar(50) output
As
Begin
Select @.name = name from table1
End
Note:
The sprocs are working fine with same collation as
SQL_Latin1_General_CP1_CI_AS
"Alejandro Mesa" wrote:
> Can you post sproc2's code?
> See "collate" clause in BOL.
>
> AMB
> "Anand" wrote:
>

Thursday, March 22, 2012

Collation and Linked servers

Hey!
I got my self a little problem with collations and linked servers..

I have access to a View on a remote server and have set up a Linked server on my SQL-server..

I get all the data I want, the only trouble I have is getting the collations to work.

My default database collation is "Finnish_Swedish" and the remote server uses the "SQL_SwedishStd_Pref_CP1_CI_AS" collation..

When I get my data, all swedish caracters are scrambled to crap and it feels like I have tried everything possible.

I've tried using "select vchDescription collate SQL_SwedishStd_Pref_CP1_CI_AS", I've set the collation to "SQL_SwedishStd_Pref_CP1_CI_AS" in the table I transfer the data to on my server, I've tried "Use Remote Collation" when setting up the linked servers, man I've tried everythin but nothing seems to work.

What am I to do? Please help me..Seems to me you should use select vchDescription collate Finnish_Swedish if you want the data in Finnish_Swedish collation.|||Did you try to create a new test db with the same collation as the remote server and do your SELECT from there? I think there is a hidden issue that results in scrambled data.|||Originally posted by Paul Young
Seems to me you should use select vchDescription collate Finnish_Swedish if you want the data in Finnish_Swedish collation.

Yupp, I tried that to, but still no luck..|||Originally posted by rdjabarov
Did you try to create a new test db with the same collation as the remote server and do your SELECT from there? I think there is a hidden issue that results in scrambled data.

What I do is, compare the data I have on my SQL-server, with the data in the remote view. The data that has changed (ins/del/upd) gets inserted into a "temporary" table (not a #-table), thereafter I download pictures and other objects (since they need processing to fit into my system) and add them to the same table. When that's finished I move the data to the live table. The remote source has e.g. the pictures on disk (I want them in my database) with a very different format (both file type and size) than I use..

Both my temporary- and live-table uses the same collation as the remote view, but still the text gets scrambled on transfer (as soon as it is inserted into the temp-table)..|||What kind of data do you see if you just do a SELECT from that view, without inserting into a temp table? Is it scrambled at that time too?sqlsql

Tuesday, March 20, 2012

collation

Hi!
I am having a problem concerning collations.
I have an SQL Server 2000 with Latin1_General_CI_AS
which contains the company data.Some of the fields are Greek and although I
cannot view them correctly in the Query Analyzer , the tool we are using
(powerbuilder) displays them OK.
now that w e want to go Internet we are facing problems with the Greek
fields not displayes correctly...
What can we do in order to have them displayed correctly?
Thanx in advance!Hi
Do you define the column which displays the database as NAVARCHAR(n)?
"P Platan" <pplat@.exnds.com> wrote in message
news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
> Hi!
> I am having a problem concerning collations.
> I have an SQL Server 2000 with Latin1_General_CI_AS
> which contains the company data.Some of the fields are Greek and although
> I cannot view them correctly in the Query Analyzer , the tool we are using
> (powerbuilder) displays them OK.
> now that w e want to go Internet we are facing problems with the Greek
> fields not displayes correctly...
> What can we do in order to have them displayed correctly?
> Thanx in advance!
>|||unfortunately no!
it is an old database.migrated from ASA...
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:e4ea9AGPGHA.1288@.TK2MSFTNGP09.phx.gbl...
> Hi
> Do you define the column which displays the database as NAVARCHAR(n)?
>
> "P Platan" <pplat@.exnds.com> wrote in message
> news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
>> Hi!
>> I am having a problem concerning collations.
>> I have an SQL Server 2000 with Latin1_General_CI_AS
>> which contains the company data.Some of the fields are Greek and although
>> I cannot view them correctly in the Query Analyzer , the tool we are
>> using (powerbuilder) displays them OK.
>> now that w e want to go Internet we are facing problems with the Greek
>> fields not displayes correctly...
>> What can we do in order to have them displayed correctly?
>> Thanx in advance!
>|||Well. please read article aboit UNICODE in the BOL
If so, you are going to alter the table and change the datatype
"P Platan" <pplat@.exnds.com> wrote in message
news:%23ttL1FGPGHA.2828@.TK2MSFTNGP12.phx.gbl...
> unfortunately no!
> it is an old database.migrated from ASA...
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:e4ea9AGPGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> Hi
>> Do you define the column which displays the database as NAVARCHAR(n)?
>>
>> "P Platan" <pplat@.exnds.com> wrote in message
>> news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
>> Hi!
>> I am having a problem concerning collations.
>> I have an SQL Server 2000 with Latin1_General_CI_AS
>> which contains the company data.Some of the fields are Greek and
>> although I cannot view them correctly in the Query Analyzer , the tool
>> we are using (powerbuilder) displays them OK.
>> now that w e want to go Internet we are facing problems with the Greek
>> fields not displayes correctly...
>> What can we do in order to have them displayed correctly?
>> Thanx in advance!
>>
>|||thanx!!
..what is BOL?
and if I alter the table will I be able to have the already stored Greek
fields displayed correctly?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23h1JdIGPGHA.1180@.TK2MSFTNGP09.phx.gbl...
> Well. please read article aboit UNICODE in the BOL
> If so, you are going to alter the table and change the datatype
>
> "P Platan" <pplat@.exnds.com> wrote in message
> news:%23ttL1FGPGHA.2828@.TK2MSFTNGP12.phx.gbl...
>> unfortunately no!
>> it is an old database.migrated from ASA...
>>
>> "Uri Dimant" <urid@.iscar.co.il> wrote in message
>> news:e4ea9AGPGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> Hi
>> Do you define the column which displays the database as NAVARCHAR(n)?
>>
>> "P Platan" <pplat@.exnds.com> wrote in message
>> news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
>> Hi!
>> I am having a problem concerning collations.
>> I have an SQL Server 2000 with Latin1_General_CI_AS
>> which contains the company data.Some of the fields are Greek and
>> although I cannot view them correctly in the Query Analyzer , the tool
>> we are using (powerbuilder) displays them OK.
>> now that w e want to go Internet we are facing problems with the Greek
>> fields not displayes correctly...
>> What can we do in order to have them displayed correctly?
>> Thanx in advance!
>>
>>
>|||> ..what is BOL?
Books On Line
> and if I alter the table will I be able to have the already stored Greek
> fields displayed correctly?
Yes, read the article in the BOL
"P Platan" <pplat@.exnds.com> wrote in message
news:OWcXWKGPGHA.2300@.TK2MSFTNGP15.phx.gbl...
> thanx!!
> ..what is BOL?
> and if I alter the table will I be able to have the already stored Greek
> fields displayed correctly?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%23h1JdIGPGHA.1180@.TK2MSFTNGP09.phx.gbl...
>> Well. please read article aboit UNICODE in the BOL
>> If so, you are going to alter the table and change the datatype
>>
>> "P Platan" <pplat@.exnds.com> wrote in message
>> news:%23ttL1FGPGHA.2828@.TK2MSFTNGP12.phx.gbl...
>> unfortunately no!
>> it is an old database.migrated from ASA...
>>
>> "Uri Dimant" <urid@.iscar.co.il> wrote in message
>> news:e4ea9AGPGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> Hi
>> Do you define the column which displays the database as NAVARCHAR(n)?
>>
>> "P Platan" <pplat@.exnds.com> wrote in message
>> news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
>> Hi!
>> I am having a problem concerning collations.
>> I have an SQL Server 2000 with Latin1_General_CI_AS
>> which contains the company data.Some of the fields are Greek and
>> although I cannot view them correctly in the Query Analyzer , the tool
>> we are using (powerbuilder) displays them OK.
>> now that w e want to go Internet we are facing problems with the Greek
>> fields not displayes correctly...
>> What can we do in order to have them displayed correctly?
>> Thanx in advance!
>>
>>
>>
>sqlsql

collation

Hi!
I am having a problem concerning collations.
I have an SQL Server 2000 with Latin1_General_CI_AS
which contains the company data.Some of the fields are Greek and although I
cannot view them correctly in the Query Analyzer , the tool we are using
(powerbuilder) displays them OK.
now that w e want to go Internet we are facing problems with the Greek
fields not displayes correctly...
What can we do in order to have them displayed correctly?
Thanx in advance!
Hi
Do you define the column which displays the database as NAVARCHAR(n)?
"P Platan" <pplat@.exnds.com> wrote in message
news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
> Hi!
> I am having a problem concerning collations.
> I have an SQL Server 2000 with Latin1_General_CI_AS
> which contains the company data.Some of the fields are Greek and although
> I cannot view them correctly in the Query Analyzer , the tool we are using
> (powerbuilder) displays them OK.
> now that w e want to go Internet we are facing problems with the Greek
> fields not displayes correctly...
> What can we do in order to have them displayed correctly?
> Thanx in advance!
>
|||unfortunately no!
it is an old database.migrated from ASA...
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:e4ea9AGPGHA.1288@.TK2MSFTNGP09.phx.gbl...
> Hi
> Do you define the column which displays the database as NAVARCHAR(n)?
>
> "P Platan" <pplat@.exnds.com> wrote in message
> news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
>
|||Well. please read article aboit UNICODE in the BOL
If so, you are going to alter the table and change the datatype
"P Platan" <pplat@.exnds.com> wrote in message
news:%23ttL1FGPGHA.2828@.TK2MSFTNGP12.phx.gbl...
> unfortunately no!
> it is an old database.migrated from ASA...
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:e4ea9AGPGHA.1288@.TK2MSFTNGP09.phx.gbl...
>
|||thanx!!
...what is BOL?
and if I alter the table will I be able to have the already stored Greek
fields displayed correctly?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23h1JdIGPGHA.1180@.TK2MSFTNGP09.phx.gbl...
> Well. please read article aboit UNICODE in the BOL
> If so, you are going to alter the table and change the datatype
>
> "P Platan" <pplat@.exnds.com> wrote in message
> news:%23ttL1FGPGHA.2828@.TK2MSFTNGP12.phx.gbl...
>
|||> ..what is BOL?
Books On Line

> and if I alter the table will I be able to have the already stored Greek
> fields displayed correctly?
Yes, read the article in the BOL
"P Platan" <pplat@.exnds.com> wrote in message
news:OWcXWKGPGHA.2300@.TK2MSFTNGP15.phx.gbl...
> thanx!!
> ..what is BOL?
> and if I alter the table will I be able to have the already stored Greek
> fields displayed correctly?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%23h1JdIGPGHA.1180@.TK2MSFTNGP09.phx.gbl...
>

collation

Hi!
I am having a problem concerning collations.
I have an SQL Server 2000 with Latin1_General_CI_AS
which contains the company data.Some of the fields are Greek and although I
cannot view them correctly in the Query Analyzer , the tool we are using
(powerbuilder) displays them OK.
now that w e want to go Internet we are facing problems with the Greek
fields not displayes correctly...
What can we do in order to have them displayed correctly?
Thanx in advance!Hi
Do you define the column which displays the database as NAVARCHAR(n)?
"P Platan" <pplat@.exnds.com> wrote in message
news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
> Hi!
> I am having a problem concerning collations.
> I have an SQL Server 2000 with Latin1_General_CI_AS
> which contains the company data.Some of the fields are Greek and although
> I cannot view them correctly in the Query Analyzer , the tool we are using
> (powerbuilder) displays them OK.
> now that w e want to go Internet we are facing problems with the Greek
> fields not displayes correctly...
> What can we do in order to have them displayed correctly?
> Thanx in advance!
>|||unfortunately no!
it is an old database.migrated from ASA...
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:e4ea9AGPGHA.1288@.TK2MSFTNGP09.phx.gbl...
> Hi
> Do you define the column which displays the database as NAVARCHAR(n)?
>
> "P Platan" <pplat@.exnds.com> wrote in message
> news:Ohzqo8FPGHA.2704@.TK2MSFTNGP15.phx.gbl...
>|||Well. please read article aboit UNICODE in the BOL
If so, you are going to alter the table and change the datatype
"P Platan" <pplat@.exnds.com> wrote in message
news:%23ttL1FGPGHA.2828@.TK2MSFTNGP12.phx.gbl...
> unfortunately no!
> it is an old database.migrated from ASA...
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:e4ea9AGPGHA.1288@.TK2MSFTNGP09.phx.gbl...
>|||thanx!!
..what is BOL?
and if I alter the table will I be able to have the already stored Greek
fields displayed correctly?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23h1JdIGPGHA.1180@.TK2MSFTNGP09.phx.gbl...
> Well. please read article aboit UNICODE in the BOL
> If so, you are going to alter the table and change the datatype
>
> "P Platan" <pplat@.exnds.com> wrote in message
> news:%23ttL1FGPGHA.2828@.TK2MSFTNGP12.phx.gbl...
>|||> ..what is BOL?
Books On Line

> and if I alter the table will I be able to have the already stored Greek
> fields displayed correctly?
Yes, read the article in the BOL
"P Platan" <pplat@.exnds.com> wrote in message
news:OWcXWKGPGHA.2300@.TK2MSFTNGP15.phx.gbl...
> thanx!!
> ..what is BOL?
> and if I alter the table will I be able to have the already stored Greek
> fields displayed correctly?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%23h1JdIGPGHA.1180@.TK2MSFTNGP09.phx.gbl...
>

Monday, March 19, 2012

Collate problems

Hi group I have a problem with collations.
Traditional_Spanish_CI_AS And Modern_Spanish_CI_AS
Are de same? Because The server has Modern_Spanish_CI_AS And the database
has Traditional_Spanish_CI_AS And somethimes in a stored procedure get an
error but I dont identify where is taht error, The error is "Error near 'S'
" and I supouse that is related with Collate.
Thanks for your helpJuan,
I don't believe "Error near 'S'" is directly a collation error. (A collation
error will not tell you what character it is having trouble with.)
It looks like the type of error message that SQL Server produces on a coding
error. Does your stored procedure create any dynamic SQL? If so, the
problem may be that in some circumstances a piece of code is being created
that is syntactically incorrect. An example can be found in this KB:
http://support.microsoft.com/kb/195979
Now, since this is related to quoted identifiers, I suppose that it is
possible that a collation mismatch inside dynamic-SQL maybe could cause a
problem, but I could not prove it without a good test case.
RLF
"Juan Manuel Alegría B." <jmalegria75@.hotmail.com> wrote in message
news:OCKGP$fLIHA.2064@.TK2MSFTNGP06.phx.gbl...
> Hi group I have a problem with collations.
> Traditional_Spanish_CI_AS And Modern_Spanish_CI_AS
> Are de same? Because The server has Modern_Spanish_CI_AS And the database
> has Traditional_Spanish_CI_AS And somethimes in a stored procedure get an
> error but I dont identify where is taht error, The error is "Error near
> 'S' " and I supouse that is related with Collate.
> Thanks for your help
>

Collate problems

Hi group I have a problem with collations.
Traditional_Spanish_CI_AS And Modern_Spanish_CI_AS
Are de same? Because The server has Modern_Spanish_CI_AS And the database
has Traditional_Spanish_CI_AS And somethimes in a stored procedure get an
error but I dont identify where is taht error, The error is "Error near 'S'
" and I supouse that is related with Collate.
Thanks for your help
Juan,
I don't believe "Error near 'S'" is directly a collation error. (A collation
error will not tell you what character it is having trouble with.)
It looks like the type of error message that SQL Server produces on a coding
error. Does your stored procedure create any dynamic SQL? If so, the
problem may be that in some circumstances a piece of code is being created
that is syntactically incorrect. An example can be found in this KB:
http://support.microsoft.com/kb/195979
Now, since this is related to quoted identifiers, I suppose that it is
possible that a collation mismatch inside dynamic-SQL maybe could cause a
problem, but I could not prove it without a good test case.
RLF
"Juan Manuel Alegra B." <jmalegria75@.hotmail.com> wrote in message
news:OCKGP$fLIHA.2064@.TK2MSFTNGP06.phx.gbl...
> Hi group I have a problem with collations.
> Traditional_Spanish_CI_AS And Modern_Spanish_CI_AS
> Are de same? Because The server has Modern_Spanish_CI_AS And the database
> has Traditional_Spanish_CI_AS And somethimes in a stored procedure get an
> error but I dont identify where is taht error, The error is "Error near
> 'S' " and I supouse that is related with Collate.
> Thanks for your help
>

Collate problems

Hi group I have a problem with collations.
Traditional_Spanish_CI_AS And Modern_Spanish_CI_AS
Are de same? Because The server has Modern_Spanish_CI_AS And the database
has Traditional_Spanish_CI_AS And somethimes in a stored procedure get an
error but I dont identify where is taht error, The error is "Error near 'S'
" and I supouse that is related with Collate.
Thanks for your helpJuan,
I don't believe "Error near 'S'" is directly a collation error. (A collation
error will not tell you what character it is having trouble with.)
It looks like the type of error message that SQL Server produces on a coding
error. Does your stored procedure create any dynamic SQL? If so, the
problem may be that in some circumstances a piece of code is being created
that is syntactically incorrect. An example can be found in this KB:
http://support.microsoft.com/kb/195979
Now, since this is related to quoted identifiers, I suppose that it is
possible that a collation mismatch inside dynamic-SQL maybe could cause a
problem, but I could not prove it without a good test case.
RLF
"Juan Manuel Alegra B." <jmalegria75@.hotmail.com> wrote in message
news:OCKGP$fLIHA.2064@.TK2MSFTNGP06.phx.gbl...
> Hi group I have a problem with collations.
> Traditional_Spanish_CI_AS And Modern_Spanish_CI_AS
> Are de same? Because The server has Modern_Spanish_CI_AS And the database
> has Traditional_Spanish_CI_AS And somethimes in a stored procedure get an
> error but I dont identify where is taht error, The error is "Error near
> 'S' " and I supouse that is related with Collate.
> Thanks for your help
>