Press "Enter" to skip to content

Dealing with Invalid Length Errors in SQL Server

Aaron Bertrand sorts out an error:

Msg 537, Level 16, State 3Invalid length parameter passed to the LEFT or SUBSTRING function.

The invalid length error, as shown above, occurs when you have incorrect or unexpected input to a string function.

Read on for examples of how you can trigger this error and what you can do to prevent it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.