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 |
waterboy1628
Starting Member
4 Posts |
Posted - 2011-05-31 : 09:37:23
|
Hello.I was wondering the best way to apply a a piece of data to another variable. Here's the issue:There are two managers, John and Tom. Bill works for John for 10 hours. Then, Bill gets a promotion and works 15 hours for Tom.How do I maintain a database so that those 10 hours are still reflected to John and the 15 hours for Tom?I think I'd have to do something at a transactional level, but I'm not exactly sure where to begin.Thanks! |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-05-31 : 10:11:24
|
Have a staff table - includes all employees including managers.Have a time allocation table.This holds employeeID, hours, period (week?), manager employeeIDAre you sure you want to allocate time by manager rather than by department or project?It's often both - employee belongs to a department and does work on a project - not necessarily connected to the department.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
waterboy1628
Starting Member
4 Posts |
Posted - 2011-05-31 : 11:20:36
|
quote: Originally posted by nigelrivett Have a staff table - includes all employees including managers.Have a time allocation table.This holds employeeID, hours, period (week?), manager employeeIDAre you sure you want to allocate time by manager rather than by department or project?It's often both - employee belongs to a department and does work on a project - not necessarily connected to the department.
I actually want to be able to allocate time to Division Vice President, a Manager, a campaign, and the representative themself. |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-05-31 : 11:40:55
|
Do you have hierarchies there?e.g. does a campaign belong to a manager belongs to a division vice president? If so that's one entry to allocate time to the campaign (lowest level of the hierarchy).You will need entries for each allocation entity that does not already have an association with something else that is allocated.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
|
|
|
|
|