String or binary data would be truncated.

  • I have a SP where i have given SET ANSI_WARNINGS ON. Inside the SP i am creating a temp table (# table) where i am inserting a record which is greater than its defined length. i.e the column of temp table is nvarchar(30) and i am trying to insert 31 characters. In one server the string data is truncated to 30 chars and inserted whereas when i execute the same in another server it is giving error like String or binary data would be truncated. Please provide the reason for this

  • Hi !

    Increase the lenght of your column.

  • Hi,

    Thanks for the response. But my query is why the record is getting inserted in one Server by truncating the last character and why it is throwing the error in another server.

  • Is the SET option defined at the PROCEDURE level?

    --Ramesh


  • Yes it is set in Procedure

  • yes the set option is defined at the procedural level

Viewing 6 posts - 1 through 5 (of 5 total)

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