The offset and length specified in the READTEXT statement is greater than the actual data length of %ld.

Error Message:
Msg 7124, Level 16, State 1, Line 5
The offset and length specified in the READTEXT statement is greater than the actual data length of %ld.

Severity level:
16.

Description:
This error message appears when you try to use a invalid offset or length in a READTEXT statement.

Consequences:
The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:
Errors of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. Both offset and length must be of valid values less than the actual data length.

Versions:
All versions of SQL Server.

Example(s):
USE pubs
DECLARE @textpointer VARBINARY(16)
SELECT @textpointer = TEXTPTR(pr_info)
  FROM pub_info
READTEXT pub_info.pr_info @textpointer 1 2500

Remarks:
In the above example we try to use use the READTEXT command with the invalid length specification of 2500. Because this value exceeeds the actual length the error is raised.




Related Articles :

  • No Related Articles Found

One Response to “The offset and length specified in the READTEXT statement is greater than the actual data length of %ld.”

  1. Hi,

    I am also getting the same error. Somehow, I cann’t figure out, it seems to be value gets updated between the Select and ReadText and throwing the same error.

    I have two question:-

    How the performance will be impacting if i will go for Select statement instead of ReadText. Anyway I have to read the whole column.

    Is there any way to put the row lock for Select and ReadText

    I really appreciate if i get some feedback on this.

    Thanks

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |