if you are asking for table structure, use below one to have multiple departments for an employee....
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EmpDeptTab](
[EmployeeID] [int] NOT NULL,
[DepartmentID] [int] NOT NULL,
[Salary] [decimal](10, 2) NULL,
CONSTRAINT [PK_composite_EmpDept] PRIMARY KEY CLUSTERED
(
[EmployeeID] ASC,
[DepartmentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/* Data
EmployeeID DepartmentID Salary
1 10 300.00
1 20 500.00
2 10 100.00
3 20 150.00 */
Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif
Kasani007, if this helps please login to Mark As Answer. | Alert Moderator