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.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Coupon data validation logic

Author  Topic 

ASP_DRUG_DEALER
Yak Posting Veteran

61 Posts

Posted - 2007-04-04 : 11:42:38
I am working on a coupon redemption project that appears to require dynamic data validation and need some help. For example, a coupon could require a person to buy XXX number of XXX items from XXX manufacture before the transaction is approved. The logical operator between each validation could also be “AND” and “OR”. My first attempt at this has been something along the lines of creating a coupon table with a child table of validation logic. However, being able to apply this logic (and at what layer) has turned out to be a challenge. I am very concerned about speed as all requirements have to be met before a transaction is approved. Any help with trying to figure out the best solution for this would be great@!

Coupons
C_ID
C_DESC
MFG_ID
MFG_OFFERNUM

Coupon_Validation
CV_ID
C_ID
MFG_ID (Manufacture)
MFG_PARTNUM (Manufacture Part Number)
CV_QTYREQUIRED (Number to meet requirements)
CV_ITEMLOGIC (AND, OR)

cmdr_skywalker
Posting Yak Master

159 Posts

Posted - 2007-04-10 : 02:26:04
Use a function (example, IsValidate()) to process the information. You can then call from the trigger or from your application the function. If all is A-OK, continue the transaction, other wise, raise the error.

Hope this helps.

May the Almighty God bless us all!

www.empoweredinformationsystems.com
Go to Top of Page
   

- Advertisement -