469,125 Members | 1,271 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,125 developers. It's quick & easy.

When to use triggers or not

348 100+
I have another question that I don't know how to answer. In my database I have a table with schedules. Each employee is assigned to one schedule. After thinking about this, I wonder what will happen if employee1 calls in sick and employee2 (Assigned to a completely different schedule) has to cover employee1's shift.

I think that the database should not allow employee2 to entered because remember, employee2 is assigned a totally different shift.

How should I go about fixing this? Should I use triggers for this?

Thanks,

Frank
Sep 24 '07 #1
3 1250
fjm
348 100+
I have another question that I don't know how to answer. In my database I have a table with schedules. Each employee is assigned to one schedule. After thinking about this, I wonder what will happen if employee1 calls in sick and employee2 (Assigned to a completely different schedule) has to cover employee1's shift.

I think that the database should not allow employee2 to entered because remember, employee2 is assigned a totally different shift.

How should I go about fixing this? Should I use triggers for this?

Thanks,

Frank
Hey guys, was my question that far out in left field? :)
Sep 25 '07 #2
Atli
5,058 Expert 4TB
Hey guys, was my question that far out in left field? :)
:)

I've never used triggers much, so I only know them in theory.

However.. I can suggest two solutions!

First: Don't assign each worker to a schedule. Assign each "login" (or whatever you call it) to a schedule. That way your workers can do a different schedule every day and your database has nothing to complain about.

Second: Don't allow your workers to change schedules! If one of them gets sick and somebody else needs to cover for him/her, have the substitute login as the first one and let them work the details out between them selves :)
(Caution, this method may cause extreme frustration, confusion and petty disagreements between your workers!)
Sep 25 '07 #3
fjm
348 100+
(Caution, this method may cause extreme frustration, confusion and petty disagreements between your workers!)
Hi Atli,

Thank you for responding.. Ok. I will redo some of the relationships to reflect that. As far as the frustration goes, as long as it is directed between themselves, and I'm not present, its all good. :)

Frank
Sep 25 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Brian McGee | last post: by
1 post views Thread by jason_s_ford | last post: by
4 posts views Thread by Mark Flippin | last post: by
7 posts views Thread by ajomara | last post: by
3 posts views Thread by rick | last post: by
debasisdas
reply views Thread by debasisdas | last post: by
4 posts views Thread by --CELKO-- | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.