I am trying to build a SQL 2005 database that has a Company data table and an Employee data table. Each company should have an Employee 1, Employee 2, and so on. I realize that each Employee record would have a PK of both their EmployeeID and their CompanyID, but I haven't for the life of me determined the best way of doing this?
Any ideas?
Let me me clarify this a bit
Each company can have its own employee #1, #2, etc. Say I have a stored procedure that returns a specific employee by passing in the company id and the requested employee id.
exec dbo.GetEmployee @CompanyID = 1, @EmployeeID = 45
Keeping in mind that Company 1 can have an Employee 1 and Company 2 can have a different Employee 1, how can I do this? How can I have an incremental primary key for employees unique for each company?