NI TestStand SQL Database Logging Issue When Modifying Data Size

Updated Dec 12, 2025

Reported In

Software

  • TestStand

Issue Details

When increasing a DATA column size from 255 to 1024 characters in a SQL Server database using the SQL Server Stored Proc (NI) schema, data may still be truncated to 255 characters during logging. 
How can parameter size mismatches and stored procedure overwrites be prevented?
 

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:

  1. Open SSMS and connect to your database.
  2. Navigate to Programmability → Stored Procedures.
  3. Locate the procedure (e.g., InsertPropResult).
  4. Right-click and select Modify.
  5. 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).