473,388 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Violation of Unique Key contraint during update

I'm using a Unique Key constraint for the first time, and I think I may not be understanding something correctly. I have a table with a Primary key (media_format_id) that is auto-increment. Then I have 3 fields which are Foreign Keys, that I also added a Unique constraint to. I do not want any 2 records with the same value combination for those three fields (media_id, format_id, lang_id).

Here is the sp_help for my table (view attached image):
IX_multimedia_formats
nonclustered, unique, unique key located on PRIMARY media_id, format_id, lang_id

PK_multimedia_formats
clustered, unique, primary key located on PRIMARY media_format_id

I use a stored procedure to create the records, and another to update them. Create works fine (unique constraint and all), but during update, I get the Violation of Unique Key contraint error every time.

Can anyone point me in the right direction ? Thank you
Attached Images
File Type: jpg sp_help.jpg (71.3 KB, 299 views)
Sep 18 '09 #1
1 3669
I found the problem. It was in the update stored procedure. My where clause syntax had an error.
Sep 18 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Westcoast Sheri | last post by:
Which will be a faster lookup of an item by, "color" in the following mySQL tables: "unique key," "primary key," or just plain "key"?? CREATE TABLE myTable ( number int(11) NOT NULL default '0',...
4
by: Q. John Chen | last post by:
All, What's the difference between a unique contraint and unique? sementically, if you want a column contain unique values, it is a contraint. And an index is for searching/sort. The questions...
6
by: J Smith | last post by:
After doing some googling through the lists and such, I wasn't able to arrive at a solution for a problem I've run into recently. I've seen mention of similar symptoms, but my case seems different....
9
by: Geraldine Hobley | last post by:
Hello I'm getting the above mentioned error in my applicatio I have a datagrid bound to a datasource like s MyDatagrid.DataSource = Mydataset.Tables(Order) - this all works fine However I...
1
by: Hugh Barnett | last post by:
I am using Visual Studio to create a VB .NET application to run on Windows 2000. I am trying to display data from a Sybase ASA table in a form, allow the user to update the data in the form, and...
6
by: Joolz | last post by:
Hi everyone, When importing a bunch of data (> 85000 rows) I get an error I can't explain. The table into which I'm importing has a unique clause on (code, bedrijf). The rows in the source-table...
5
by: Vayse | last post by:
In my save code, most of items save fine. But sometimes I get a concurrency violation message. "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records." It happens on the...
12
by: Pietro Cerutti | last post by:
Dear all, I would like to open another topic to try to clarify a doubt raised on my previous post today with the subject 'printf("%d%d%d")'. Reading through the standard, I cannot find a clear...
6
by: Alvin SIU | last post by:
Hi all, I have a table in Db2 v8 like this: Team Name Role ------ -------- --------------------- A Superman Leader A Batman Member A WonderWoman Member B ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.