Solved

MSSQL vor and wor is considered equals?

Posted on 2011-03-10
8
438 Views
Last Modified: 2012-05-11
Hi,

I have an update statement where i try to insert the text "vor" into a column called username. There is already a username = 'wor", and the system gives me a:

Violation of UNIQUE KEY constraint 'tc_usertbl_username'. Cannot insert duplicate key in object 'dbo.usertbl'.

as we all can see, wor is not like vor, but my sql server seems to think differently..

i have tried to change username to nvarchar, and it seems to work, but this is an old system, and i have no idea if anybody has done a "select * from usertbl" and referenced the position instead of column names. if so, the workaround i have done will make it fail.

i do not want to create a new table, move data, drop foreign keys, drop old, rename new, create new foreign keys, because i have no idea how many fk's there are..

does anybody have any easier way of getting around this problem?
0
Comment
Question by:dds_felles
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35094164
what is the collation of the field?
0
 
LVL 1

Author Comment

by:dds_felles
ID: 35094274
i dont know.. .

where do i find the collation for that specific field?

0
 
LVL 1

Author Comment

by:dds_felles
ID: 35094277
found it : SQL_Scandinavian_CP850_CI_AS
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 35094359
>SQL_Scandinavian_CP850_CI_AS
that is indeed "problem", it considers the v and the w to be identical indeed.
you need to change the collation of that column (to sql latin for example) to solve that problem (but it might raise other issues ...)
0
 
LVL 1

Author Comment

by:dds_felles
ID: 35094527
thanks, ill try it out. do you know how to change the collation on a single clomn?

0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 35094664
>>do you know how to change the collation on a single clomn?<<
As angelIII has pointed out v and w are the same, at least if you are Swedish.  Look up the COLLATE keyword.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35094680
0
 
LVL 1

Author Closing Comment

by:dds_felles
ID: 35094814
Thank you for the quick and correct reply :)
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question