Introduction

Controls the way the column stores values shorter than the defined size of the column, and the way the column stores values that have trailing blanks in charvarcharbinary, and varbinary data.

  • SET ANSI_PADDING ON – preserves the trailing blanks in the string values when they are inserted into a column. This is ANSI-compliant behavior.
  • SET ANSI_PADDING OFF – trims the trailing blanks in the string values when they are inserted into a column. This is not recommended behavior.

Problem

Enable ANSI_PADDING

Solution

https://github.com/steverezhener/DBA/blob/master/Procedures/bestpractices.usp_change_ansi_padding.sql

Based on

https://www.madeiradata.com/post/what-is-ansi_padding-and-why-we-should-use-it