Wonderware Historian2023R2SP1P1 "GetNextDataQueryResult failed" Warning

Hi everyone,

I’m experiencing an issue with AVEVA Historian 2023R2SP1P1 related to data delay and a specific warning message in the Log Viewer. Here’s the context:

I’m using the following stored procedure to insert tag data into INSQL.Runtime.dbo.StringHistory:

USE [Runtime]
GO
ALTER PROCEDURE [dbo].[UDP_InsertStringHistory]
    @Tagname NVARCHAR(255), 
    @Value NVARCHAR(4000) 
AS
BEGIN
    SET NOCOUNT ON;

    INSERT INTO INSQL.Runtime.dbo.StringHistory (
        DateTime,
        TagName,
        Value,
        wwTimeZone,
        wwVersion
    )
    VALUES (
        GETDATE(),
        @Tagname,
        @Value,
        'SE Asia Standard Time',
        'Original'
    );
END;

The tag I'm working with is SKU_Barcode_PC, and data is being written into Historian via this stored procedure.

Problem:
Occasionally, I see the following warning somtime in the Log Viewer:


GetNextDataQueryResult failed (17;2025/07/24: 21:45:00.677 --> 21:46:00.677; 2; SKU_Barcode_PC; error = 68 (Invalid item size)) [HISTORIAN-VM; o_pdsqry.cpp; 416]



Additionally, I’ve noticed a delay in the availability of data. For example, at 14:00 today, the latest available data is only up to 23:59 of the previous day. After waiting 3–4 hours and running the same query again, the data finally appears up to the current time.

I’m worried that my implementation might be causing the delay or the warning, so any insight or suggestions would be really helpful.

Thanks in advance!