Differences

This shows you the differences between two versions of the page.

sql-server:ansi_padding [December 14, 2011 4:41 am]
sqlines
sql-server:ansi_padding [December 14, 2011 4:41 am] (current)
sqlines
Line 5: Line 5:
| **Syntax** | **SET ANSI_PADDING ON %%|%% OFF** || | **Syntax** | **SET ANSI_PADDING ON %%|%% OFF** ||
| **Value ON** | CHAR(n)  | Padded with spaces to //n//, and //n// spaces retrieved || | **Value ON** | CHAR(n)  | Padded with spaces to //n//, and //n// spaces retrieved ||
-|:::| VARCHAR | Trailing spaces are stored and retrieved if data contains them ||+|:::| VARCHAR(n) | Trailing spaces are stored and retrieved if data contains them ||
| **Value OFF** | CHAR(n) padded with spaces to //n//, but **no** spaces retrieved || | **Value OFF** | CHAR(n) padded with spaces to //n//, but **no** spaces retrieved ||
-|:::| VARCHAR | Trailing spaces truncated ||+|:::| VARCHAR(n) | Trailing spaces truncated ||
| **Default** | ON || | **Default** | ON ||
| **Notes** | Affects **new** tables only, does not affect the existing tables || | **Notes** | Affects **new** tables only, does not affect the existing tables ||
-|:::| ANSI_PADDING is always ON for VARCHAR(max), NCHAR, NVARCHAR and TEXT data types ||+|:::| ANSI_PADDING is always ON for VARCHAR(max), NCHAR, NVARCHAR and TEXT ||
|:::| SET ANSI_DEFAULTS ON/OFF automatically sets ANSI_PADDING ON/OFF || |:::| SET ANSI_DEFAULTS ON/OFF automatically sets ANSI_PADDING ON/OFF ||
| **Get Current** | Execute //SELECT SESSIONPROPERTY('ANSI_PADDING')// or //DBCC USEROPTIONS// || | **Get Current** | Execute //SELECT SESSIONPROPERTY('ANSI_PADDING')// or //DBCC USEROPTIONS// ||