ease20022002
Technical User
Hi,
I have reviewed a few articles on locking data (record locks, table locks, etc) and on constraints, which appear easier. I am looking for guidance on which level locking I should use in a SQL Server 2005 db and how best to apply constraints to a table.
I am developing a staffing profile (employee time allocator for software development project managers) that could have 10k to 40k records (all employees, offshore, etc.). Each employee can be assigned to multiple projects as far out as 2 years, so 24 * each employee.
As you can imagine, two or more project managers at one time could access one employee and try to allocate that employee to a project at the same time. One employee will have only so much time that can be allocated to a project each month, so one employee will have, at the beginning of the year, two years worth of time to be allocated, which means there will be 24 records for each employee that can be allocated. Obviously, as time passes the records not updateable as they are in the past.
I guess I want to know what is the best level for locking the records when one project manager is accessing one employee. I want the employee locked, not the month.
Also, how easy is it to put a constraint on the allocating field, say hours, so the hours can not exceed 160 in one month (I know hours/month are not constant but it doesn't matter for this example as the metric isn't hours, just using as an example)?
Thank you for any information provided.
I have reviewed a few articles on locking data (record locks, table locks, etc) and on constraints, which appear easier. I am looking for guidance on which level locking I should use in a SQL Server 2005 db and how best to apply constraints to a table.
I am developing a staffing profile (employee time allocator for software development project managers) that could have 10k to 40k records (all employees, offshore, etc.). Each employee can be assigned to multiple projects as far out as 2 years, so 24 * each employee.
As you can imagine, two or more project managers at one time could access one employee and try to allocate that employee to a project at the same time. One employee will have only so much time that can be allocated to a project each month, so one employee will have, at the beginning of the year, two years worth of time to be allocated, which means there will be 24 records for each employee that can be allocated. Obviously, as time passes the records not updateable as they are in the past.
I guess I want to know what is the best level for locking the records when one project manager is accessing one employee. I want the employee locked, not the month.
Also, how easy is it to put a constraint on the allocating field, say hours, so the hours can not exceed 160 in one month (I know hours/month are not constant but it doesn't matter for this example as the metric isn't hours, just using as an example)?
Thank you for any information provided.