REQUIREMENTS → CONFIGURATION
Less scripting.
More clarity.
Define your order item types. Turn the details into a consistent, reviewable SQL seed template.
Three fields. One focused template. ID, fee description, and display name. Other configuration columns are deliberately excluded from this demo.
01 / DEFINE
Order Item Type
Start at a known available ID. IDs already in this script are skipped.
02 / REVIEW
Your seed rows 0
A clear starting point.
Add your first order item type above.
Each saved item becomes one SQL row.
03 / GENERATE
Script preview
-- ORDER ITEM TYPE
-- Demo seed template: ID, fee description, and display name only.
-- Review before adapting to a destination schema. No database is connected.
-- This table variable has no identity column; IDENTITY_INSERT is not required.
DECLARE @ORDER_ITEM_TYPE_TEMP_TABLE TABLE
(
[ORDER_ITEM_TYPE_ID] INT NOT NULL PRIMARY KEY,
[ORDER_ITEM_TYPE_DESC] NVARCHAR(500) NOT NULL,
[ORDER_ITEM_TYPE_DISPLAY_NAME] NVARCHAR(100) NOT NULL
);
-- Add an order item type to generate VALUES rows.
Demo table variable only. No destination-table insert or database ID check. Review and adapt the script before use.
SECOND SECTION / DEFINE THE BREAKDOWN
Fee Groups
Add a display name for each fee component, then link it to an Order Item Type. Add as many rows as you need.
Names and assignments only. Fee amounts and calculation rules are not inferred. Fee Group defaults are active 1, convenience fee 0. Assignment IDs use a separate sequence.
01 / DEFINE & REVIEW
Your Fee Groups 0
Set the first IDs before adding a row. Later rows increment and skip used IDs; database IDs are not checked.
Create an Order Item Type first so each Fee Group has a valid parent.
Go to Order Item TypeThe new row expands here. Its IDs start at the next unused values.
02 / GENERATE
Fee Group scripts
-- FEE GROUP
-- Demo seed table variable. Persist these rows to your actual Fee Group table separately.
-- Template defaults: IS_ACTIVE = 1, IS_CONVENIENCE_FEE = 0.
DECLARE @FEE_GROUP TABLE
(
[FEE_GROUP_ID] INT NOT NULL PRIMARY KEY,
[FEE_GROUP_DISPLAY_NAME] NVARCHAR(50) NOT NULL,
[IS_ACTIVE] BIT NOT NULL,
[IS_CONVENIENCE_FEE] BIT NOT NULL
);
-- Add Fee Groups to generate VALUES rows.
This seed populates @FEE_GROUP only. It does not create records in a destination Fee Group table.
THIRD SECTION / DEFINE THE CALCULATION
Fee Calculations
Configure flat, after-free-count, or penalty Fee Codes, then select the Fee Groups they belong to. Groups are filtered by their Order Item Type.
Structured fee inputs. Flat amount, per-item cost, Pages/Names, and skipped counts generate parameter rows. Penalty adds its procedure row only; no penalty parameter contract has been supplied.
01 / DEFINE & ASSIGN
Fee Codes 0
Five digits, preserving leading zeros. Example default: 48000. Format is checked; county existence is not verified.
[VG48000].CalcFlatFee
Parameter IDs are generated in saved-code order. After edits, regenerate both parameter files together; do not mix different snapshots.
Save an Order Item Type and at least one Fee Group first.
02 / GENERATE
Fee Calculation scripts
-- FEE CODE
-- Seeds a table variable only. It does not deploy or execute stored procedures.
-- Amounts and count inputs are in the separate parameter and parameter-link exports.
-- Penalty parameters/signature were not supplied; no penalty parameter rows are invented.
DECLARE @FEE_CODE TABLE
(
[FEE_CODE_ID] INT NOT NULL PRIMARY KEY,
[FEE_CODE_DISPLAY_NAME] NVARCHAR(50) NOT NULL,
[IS_ACTIVE] BIT NOT NULL,
[IS_FORMULA] BIT NOT NULL,
[IS_SP] BIT NOT NULL,
[FORMULA] NVARCHAR(50) NULL,
[SP_NAME] NVARCHAR(100) NULL
);
-- Add a Fee Code to generate VALUES rows.
No procedures or calculations run here. Parameter output is an INSERT fragment: its @FEE_CODE_PARAMETER declaration was not supplied. Other seeds are table variables only. Destination records must exist before running relationship inserts. SQL Server execution remains unverified.