Solution
This happens because stored procedure parameter definitions take precedence over table column sizes. To avoid issues with SQL Database Schemas parameter sizing, consider the options below:
Option 1: Use Unique Procedure Names
- Give each table its own procedure name (e.g.,
InsertPropResult_STEP_NUMERICLIMIT1). - Update the TestStand schema to reference the correct procedure for each table.
Option 2: Consolidate Logic
- If you prefer one procedure for multiple tables, define shared parameters using the largest required size (e.g.,
VARCHAR(1024)). - Ensure all tables can handle that size.
Option 3: Updating an Existing Stored Procedure
If your tables are already created and contain data, you can modify the stored procedure without losing data:
- Open SSMS and connect to your database.
- Navigate to Programmability → Stored Procedures.
- Locate the procedure (e.g.,
InsertPropResult). - Right-click and select Modify.
- Update the parameter definition as shown below:
ALTER PROCEDURE [dbo].[InsertPropResult]
@pID UNIQUEIDENTIFIER,
@pSTEP_RESULT UNIQUEIDENTIFIER,
@pPROP_PARENT UNIQUEIDENTIFIER,
@pORDER_NUMBER INT,
@pNAME VARCHAR(255),
@pPATH VARCHAR(1024),
@pCATEGORY INT,
@pTYPE_VALUE INT,
@pTYPE_NAME VARCHAR(255),
@pDISPLAY_FORMAT VARCHAR(32),
@pDATA VARCHAR(1024) -- Updated size
AS
INSERT INTO STEP_NUMERICLIMIT1 (ID, STEP_RESULT, PROP_PARENT, ORDER_NUMBER, NAME, PATH,
CATEGORY, TYPE_VALUE, TYPE_NAME, DISPLAY_FORMAT, DATA)
VALUES (@pID, @pSTEP_RESULT, @pPROP_PARENT, @pORDER_NUMBER, @pNAME, @pPATH, @pCATEGORY,
@pTYPE_VALUE, @pTYPE_NAME, @pDISPLAY_FORMAT, @pDATA);
6. Click Execute to apply changes.
7. Reload the schema in TestStand (Configure → Database Options → Reload NI Schemas).