Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Sanette
Starting Member
3 Posts |
Posted - 2002-07-19 : 03:08:59
|
| It would be great if someone can help me out on this one. I have the following data:ITEMFROM ITEMTO ALLOWED?ItemA ItemB YesItemA ItemC YesItemB ItemD YesItemC ItemD YesItemD ItemB NoItemD ItemA NoItemE ItemB YesItemF ItemB YesItemF ItemC YesItemA ItemA NoMy current code looks like this:IF (SELECT COUNT(*) FROM tbl_SupercessionHeader WHERE ItemMasterIDFrom = @iFromItemMasterID ) > 0 BEGIN RETURN END IF (SELECT COUNT(*) FROM tbl_SupercessionHeader WHERE ItemMasterIDFrom = @iToItemMasterID ) > 0 BEGIN RAISERROR ('Item has circular referencing',16,1) RETURN ENDThe problem with the code is that if an Item is already superceded it cannot be superceded again, e.g. ItemA --> ItemB, ItemA --> ItemC will not be allowed (and it should).Any ideas????? |
|
|
|
|
|