This is a discussion on UML and SQL within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello, could anybody write me how to write an implementation "xor" association ( used in UML ) in sql ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Kind of like this? select * from MyTable where ( col1 = 1 or col2 = 1 ) and not ( col1 = 1 and col2 = 1 ) "Tatiana" <statiana@poczta.onet.pl> wrote in message news:d7f16b12.0412171639.71286685@posting.google.c om... > Hello, could anybody write me how to write an implementation "xor" > association ( used in UML ) in sql ? |
| |||
| Unfortunately it is necessary for me during creating table. For example for one position on bill, which must be described by (IdBill, IdPosBill, IdServices, IdReserve, Amount). And one position on the bill can concern either services, or reserve. If one concerns services, so IdReserve must be NULL and inversely. The problem is how to create such table. Thank for reply *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
| |||
| I am not sure that you can specify that kind of thing in a table constraint. You may need to create a trigger on the table to disallow that. "Tatiana Suchodolska" <statiana@poczta.onet.pl> wrote in message news:41c3b842$1_2@127.0.0.1... > > Unfortunately it is necessary for me during creating table. For example > for one position on bill, which must be described by (IdBill, IdPosBill, > IdServices, IdReserve, Amount). And one position on the bill can concern > either services, or reserve. If one concerns services, so IdReserve must > be NULL and inversely. The problem is how to create such table. Thank > for reply > > *** Sent via Developersdex http://www.developersdex.com *** > Don't just participate in USENET...get rewarded for it! |