Solved

MSSQL vor and wor is considered equals?

Posted on 2011-03-10
8
427 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]
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
 
LVL 142

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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 142

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

863 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

29 Experts available now in Live!

Get 1:1 Help Now