Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique index on a text field problem

Status
Not open for further replies.

SA23

Programmer
Oct 2, 2001
7
AU
Hi all,

I have got a table TEMPO with only one column CODE of varchar type with the unique index on it.
There are two records in the table:
record1 contains Code1
record1 contains Code2

***********************
Problem definition:
***********************
Running the following update sql:

update TEMPO
set CODE = 'code1'
where CODE = 'Code2'

modifies the table so that record1 has Code1 and record2 has code1. This is exactly how we expect it to work as the unique index on the text fields is case sensitive (Code1 and code2 are not the same, the case is different)


Running the following insert sql:

insert into TEMPO
values ('coDe1')

throws an error indicating that this insert statement conflicts with the unique index placed on the CODE column.

Is it a bug in SQL Server or am I missing something?


Thank you all in advance.

SA23.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top