Link to home
Start Free TrialLog in
Avatar of tampsystems
tampsystemsFlag for United States of America

asked on

The next problem to this question

We came across the next problem today.  

When existing data in the table contains the reverse condition, we cannot add any other records.

The Table contains the following:
GA = 111, GB = 222
GA = 222, GB = 111
Then we cannot add this:
GA = 222, GB = 333


see previous question
https://www.experts-exchange.com/questions/24984214/SQL-Database-Table.html?cid=1575&anchorAnswerId=26065700#a26065700
Avatar of tampsystems
tampsystems
Flag of United States of America image

ASKER

Also, i tried to add the following record and it did not work.
Table contains:
111, 222
333, 444
555, 444

Record to insert
222, 444

I think maybe the trigger was incorrect?
And this did not allow me to insert too:
Table contains:
B7, B6
F8, C7

Record to insert
EC, C7
ASKER CERTIFIED SOLUTION
Avatar of lof
lof
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
wow, that was simple and gunius at the same time! thanks!
This worked great from using the query analyzer but we ran in to trouble when executing an insert from our application.  We got the following error.  Do you have any ideas on what is causing this?  We believe there is something going wrong when the binarychecksum column is being calculated.

"INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods."
Is it possible that in your code you are trying to insert null value?

you may try for debuging set this

SET ARITHABORT OFF;
GO

and then see what the BinaryCheckSum looks like. I assumed the key may not be null and in case any of two fields is null the result will be null.

remember to set the ARTIHABORT back to on after testing