Table: dbo.Employee_W2_Filing
This table stores the period end years for each employee that have overrides for each w2 filing type
Columns
NameTypeConstraintsDescription
employee_w2_filing_KEYint (4)NOT NULLPrimary key of this table
employee_KEYint (4)NOT NULLEmployee key corresponding to the employee whose data has been overridden
w2_override_type_KEYint (4)NOT NULLDistinguishes the type of filing which has been overridden
period_end_yearsmallint (2)NOT NULLDistinguishes the employees based on the period end year for the respective overrides
Primary key
NameColumnsDescription
PK_Employee_W2_Filingemployee_w2_filing_KEY
Unique constraints
NameColumnsDescription
UK_Employee_W2_Filing$employee_KEY$w2_override_type_KEY$period_end_yearemployee_KEY, w2_override_type_KEY, period_end_year
Foreign keys
NameColumnsReferenced tableDescription
FK_Employee_W2_Filing__Employee__employee_KEYemployee_KEYEmployee (employee_KEY)FOREIGN KEY constraint of employee_KEY for the Employee_W2_Filing table which ensures we have a valid employee
FK_Employee_W2_Filing__W2_Override_Type__w2_override_type_KEYw2_override_type_KEYW2_Override_Type (w2_override_type_KEY)FOREIGN KEY constraint of w2_override_type_KEY for the Employee_W2_Filing table which ensures valid w2 override type
Incoming foreign keys
NameColumnsReferencing tableDescription
FK_Employee_W2_Box_12_Override__Employee_W2_Filing__employee_w2_filing_KEYemployee_w2_filing_KEYEmployee_W2_Box_12_OverrideFOREIGN KEY constraint of employee_w2_filing_KEY for the Employee_W2_Box_12_Override table which ensures the Employee_W2_Box_12_Override is for a valid filing
FK_Employee_W2_Box_14_Override__Employee_W2_Filing__employee_w2_filing_KEYemployee_w2_filing_KEYEmployee_W2_Box_14_OverrideFOREIGN KEY constraint of employee_w2_filing_KEY for the Employee_W2_Box_14_Override table which ensures the Employee_W2_Box_14_Override is for a valid filing
FK_Employee_W2_Override__Employee_W2_Filing__employee_w2_filing_KEYemployee_w2_filing_KEYEmployee_W2_OverrideFOREIGN KEY constraint of employee_w2_filing_KEY for the Employee_W2_Override table which ensures the Employee_W2_Override is for a valid filing
FK_Employee_W2_Tax_Jurisdiction_Override__Employee_W2_Filing__employee_w2_filing_KEYemployee_w2_filing_KEYEmployee_W2_Tax_Jurisdiction_OverrideFOREIGN KEY constraint of employee_w2_filing_KEY for the Employee_W2_Tax_Jurisdiction_Override table which ensures the Employee_W2_Tax_Jurisdiction_Override is for a valid filing

Schema diagram