• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Business rules

Hi,

I've got a scenario in my database whereby the existence of a record in one table SHOULD depend on the existence of another record in another table...e.g When i create a record in 'Table A' i currently create a related record into 'Table B'. I do this because i know that the system needs this record for other events that will take place around the website....the problem is that i know this cause i developed the system, any other DB administrator wouldn't have a clue that this relationship needed to exist...is this a business rule that is needed? Is this where i would use a trigger???

Thanks in advance

Al
0
higgsy
Asked:
higgsy
2 Solutions
 
andrewbleakleyCommented:
Use of a trigger would help as long as another developer knew it was there. business rules are such that you can make any as long as you document them.

A trigger is a good solution for now - except that you have to ensure the next bloke knows it is there, knows why it is there and knows how to edit it if necessary.

a loose relationship like that (that is not enforced by foreign keys) are really tricky to find later on down the road. BUT it is you project and as long as you have sufficient docs the next bloke will be fine.
0
 
wolffy18Commented:
if you are adding records using a stored procedure, which I reccomend. Then you can use your business logic there. you can comment your logic, and  if  you use a trigger, comment it in the stored procedure as well.

This helps organize your business also.

Steven.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now