Solved

MSSQL vor and wor is considered equals?

Posted on 2011-03-10
8
423 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
  • 4
  • 3
8 Comments
 
LVL 142

Expert Comment

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

Author Comment

by:dds_felles
Comment Utility
i dont know.. .

where do i find the collation for that specific field?

0
 
LVL 1

Author Comment

by:dds_felles
Comment Utility
found it : SQL_Scandinavian_CP850_CI_AS
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
>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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:dds_felles
Comment Utility
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
Comment Utility
>>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 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
0
 
LVL 1

Author Closing Comment

by:dds_felles
Comment Utility
Thank you for the quick and correct reply :)
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now