Table: dbo.Employee_W2_Rendered_Document
Table used to store pre-rendered employee W2 documents.
Columns
Name | Type | Constraints | Description
employee_w2_rendered_document_KEY | int (4) | NOT NULL | Primary key for table.
form_year | int (4) | NOT NULL | Filing year of the document
employee_KEY | int (4) | NOT NULL | Primary key of the employee associated with this row's documents.
report_definition_KEY | int (4) |  | Key of the associated report; a null value means the document is associated with a tax form instead of a report.
facsimile_document | varbinary (-1) |  | Cached ActiveReport page of a particular W2 form, the facsimile copy which includes all form graphics plus field data.
data_only_document | varbinary (-1) |  | Cached ActiveReport page of a particular W2 form, the pre-printed copy which only includes field data, no form graphics.
barcode_overlay_document | varbinary (-1) |  | Cached ActiveReport page of a W2 barcode for the w2 documents. User option to include, so we dynamically overlay when it's required.
tax_form_KEY | int (4) |  | Key of the associated tax form; a null value means the document is associated with a report instead of a tax form.
render_date | smalldatetime (4) | NOT NULL | Date the document was rendered.
overflow_order | int (4) | NOT NULL | Indicates the overflow order for employee w2 documents when data overflows into more than 1 w2 for an employee. This is zero-based.
ste_state_code_KEY | nvarchar (4) |  | Certain reports are state specific. For those reports, this column will contain the key for the corresponding state.
tax_agent_KEY | int (4) |  | Certain reports are specific to a locality. For those reports, this column will contain the key for the tax agent for that locality.

Primary key
Name | Columns | Description
PK_Employee_W2_Rendered_Document | employee_w2_rendered_document_KEY |
Unique constraints
Name | Columns | Description
UK_Employee_W2_Rendered_Document$form_year$report_definition_KEY$tax_form_KEY$employee_KEY$overflow_order$ste_state_code_KEY$tax | form_year, report_definition_KEY, tax_form_KEY, employee_KEY, overflow_order, ste_state_code_KEY, tax_agent_KEY |

Foreign keys
Name | Columns | Referenced table | Description
FK_Employee_W2_Rendered_Document__Ste_State_Code__ste_state_code_KEY | ste_state_code_KEY | Ste_State_Code (ste_state_code_KEY) |
FK_Employee_W2_Rendered_Document__Tax_Agent__tax_agent_KEY | tax_agent_KEY | Tax_Agent (tax_agent_KEY) |
FK_Employee_W2_Rendered_Document__Employee__employee_KEY | employee_KEY | Employee (employee_KEY) |
FK_Employee_W2_Rendered_Document__Report_Definition__report_definition_KEY | report_definition_KEY | Report_Definition (report_definition_KEY) |
FK_Employee_W2_Rendered_Document__Tax_Form__tax_form_KEY | tax_form_KEY | Tax_Form (tax_form_KEY) |