Staging Table Structure
The staging table holds system columns plus one column per non-system attribute. Every attribute column is NVARCHAR(MAX) — the processing engine handles type conversion and validation, not the column type.
Watch the table itself in eight minutes — every system column read out, why the attribute columns are all text, and how a batch tag lets two feeds share one table without touching each other's rows:
System columns
| Column | Type | Description |
|---|---|---|
Id | BIGINT IDENTITY | Auto-generated row id |
Code | NVARCHAR(200) NOT NULL | The entity code (business key) to insert, update or delete |
Name | NVARCHAR(500) | The entity name |
NewCode | NVARCHAR(255) | Set this to rename a code |
ImportAction | TINYINT | The operation to perform (see below) |
ImportStatus | TINYINT | Processing status — set to 0 for new rows |
BatchId | INT | Assigned automatically during batch processing |
BatchTag | NVARCHAR(100) | Optional label for grouping rows in a batch |
ErrorCode | INT | Bitmask of error codes, set by the engine |
SourceSystem | NVARCHAR(100) | Optional label recording where the row came from |
SourceTimestamp | DATETIME2 | Optional timestamp from the source system |
CreatedAt | DATETIME2 | When the row was inserted |
On an entity with Auto-generate Code, leave Code as an empty string for an insert (ImportAction 0 or 1) and one is assigned. Supply it for update, delete and rename, which match an existing record on it.
Attribute columns
One column per entity attribute, named after the attribute. Domain attributes accept the code of the target entity, not its internal id.
Inserting rows
ImportAction values
Watch each action staged and processed in six minutes — insert, update, delete and delete cascade, including why plain delete is refused when another record still points at the row:
| Value | Action | Behavior |
|---|---|---|
0 | Upsert | Insert if the code does not exist, update if it does (default) |
1 | Insert only | Fail if the code already exists |
2 | Update only | Fail if the code does not exist |
3 | Delete | Remove the record. Refused if another entity still points at it |
5 | Delete cascade | Empty the fields that point at it first, then remove the record |
3 and 5 while the documentation described them as more forceful, so choosing one gave you something other than what it said. A row still carrying 4 or 6 is rejected with *Invalid ImportAction*, and the message names the action to use instead. Change your source system to send 3 or 5.Delete or delete cascade
Two entities: Products and Orders. Order #77 points at product P-100. Your source system sends *"delete P-100"*.
| Action | What happens |
|---|---|
3 Delete | Refused. The row comes back as an error saying P-100 is still referenced. Nothing is deleted, and order #77 is untouched |
5 Delete cascade | Order #77's product field is emptied first, then P-100 is deleted. Order #77 still exists — it simply no longer has a product |
Delete is the safe default. It will not let an import quietly break a link something else depends on. Reach for delete cascade when you genuinely mean *"remove this record and clear whatever pointed at it"*.
There is deliberately no third option that deletes the record and leaves order #77 pointing at something that no longer exists. That pushes the problem into a report weeks later, where the cause is nearly impossible to find.
ImportStatus values
| Value | Meaning | When set |
|---|---|---|
0 | Ready | Set by the external system. Only rows with status 0 are picked up |
1 | OK | Set by the engine after successful processing |
2 | Error | Set by the engine when processing fails. Check ErrorCode |
3 | Processing | Set briefly during batch execution |
ImportStatus = 0 when inserting new rows. The engine ignores rows with any other status.Domain attributes
For a column that references another entity, insert the code of the target record:
The engine resolves 'EUR' to the internal Currency row id. If the code does not exist, the row fails with error code 8192 (Domain value not found).
Renaming a code
Use the NewCode column to change an entity's business key:
This updates the existing USD row's code to US-DOLLAR. The engine checks that NewCode does not already exist in production, and that no two rows in the same batch carry the same NewCode.
Related
- Staging Overview — what staging is and how to enable it
- Staging Configuration — how staged values merge into production
- Processing & Errors — the full error-code list
- Drift & Rebuild — keeping these columns matched to the attributes
- Attributes & Data Types — the types the engine converts to