:::: MENU ::::

ANSI Padding Enabled (ANSI_PADDING) in SQL Server T-SQL

  • Nov 05 / 2008
  • 0
dbDigger, T-SQL Interview Questions

ANSI Padding Enabled (ANSI_PADDING) in SQL Server T-SQL

ANSI Padding option is used to control the padding of strings for comparison and insert operations.

When set to TRUE in SQL Server Management Studio or ON when using the ALTER DATABASE command, all strings are padded to the same length before conversion or insertion into a varchar or nvarchar data type. Trailing blanks in character values inserted into varchar or nvarchar columns and trailing zeros in binary values inserted into varbinary columns are not trimmed.

When set to FALSE, trailing blanks for varchar or nvarchar, and zeros for varbinary are trimmed.

It is important to note that connection-level settings that are set by using the SET statement override the default database setting. Generally, it is recommended you keep this option set to TRUE.

Consult us to explore the Databases. Contact us