Posts: 313
Threads: 20
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jul 2011
Reputation:
0
The column that has primary key it has a constraint( to not let duplicates ID ),and it is used for tables relationships.
Since you didnt post the Update SQL query, and in what I saw just a part of it, in what I saw is that you forgot to put the condition for the Query.
Your current query is:
UPDATE table SET columns=xxxx,coklumn2=yyyyyyyy
Which without condition will apply to all rows in the table(the first row will change successfully and when it will apply the settings on the second row, it will pop up an exception about your constraint)
:
The proper method to use Update for a certain row is(this way will apply to the rows that columnX is zzz):
UPDATE table SET columns=xxxx,coklumn2=yyyyyyyy WHERE columnX=zzz
I suggest reading more about SQL.
Posts: 190
Threads: 13
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Feb 2013
Reputation:
0
Okey i try it out. Thanks