i have 3 tables namely transemployee, refDesignation and refEmployeetype table. the transemployee table is the main table where i have columns like empid,firstname,middlename,lastname,entrepriseid,mailid,designationId,employeetypeid,createdon,modifiedon and isactive columns.
the other tables have designationid,designation(refdesignation table) and employeetupeid and employeetype..
in the trans emplyee table empid is d primary key and in refemployeetype and refdesignation table designationid and employeetypeid is the primary key
these act as foreign keys in transemployee table.
now if i ngive a insert query like this i get the following error:
INSERT INTO [UserManagementDB].[dbo].[TransEmployee]
([FirstName]
,[MiddleName]
,[LastName]
,[EntrepriseId]
,[MailId]
,[DesignationId]
,[EmployeeTypeId]
,[CreatedOn]
,[ModifiedOn]
,[IsActive])
VALUES
('abi','raman','shankar','abi.r.shank','abi..shank@accenture.com',1,2,12/11/2012,13/11/2012,0)
GO
i get hte error as The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TransEmployee_RefDesignation". The conflict occurred in database "UserManagementDB", table "dbo.RefDesignation", column 'DesignationId'.