LEN(REPLICATE('X',8001))

  • Does anyone know why below returns an unexpected result?

    PRINT LEN(REPLICATE('X',8001))

    Thanks in advance,

    Billy

  • By unexpected results, do mean why is the length 8000, instead of 8001? If so, the max length of a character string in SQL Server is 8000 characters long, therefore the string returned from the REPLICATE function will be no longer than 8000 characters.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply