Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 TrimTrailingBlanks, CHAR, and VARCHAR

Author  Topic 

burt
Starting Member

4 Posts

Posted - 2014-07-06 : 05:14:15
I am a long-time Oracle user who has recently started using SQL Server. I am trying to understand how the TrimTrailingBlanks setting relates to CHAR and VARCHAR. It seems that TrimTrailingBlanks affects padding that is visible to SQL statements, whereas my understanding of CHAR (at least on Oracle) is that the padding is physical only, not visible when the data is accessed via SQL. I believe the main reason to use CHAR is to pre-allocate space to help prevent fragmentation and/or chaining if updates with bigger values are common in that column. However, I am unclear on why we would ever want pre-allocated space to be visible in SQL. I suspect the Trailing Blanks feature is for an entirely different purpose and would like to understand.

Thanks in advance.

Cheers,
Burt
   

- Advertisement -