title: CHAR behavior with trailing spaces
body: <p>Given the SQL statements below, I would expect the result of the query to be:</p>
  
  <pre><code>|testX|5|
  |XXXXX|5|
  </code></pre>
  
  <p>This is because the column is a char(5) and I would expect it to insert blank trailing spaces to fill the remaining space in the column since the inserted values are less than five characters.  However, the query actually produces the following result:</p>
  
  <pre><code>|test|4|
  |X|0|
  </code></pre>
  
  <p>Can someone please explain this.  Why aren't the values padded with trailing blanks to make them fill up the length 5 column?  Why does the REPLACE function insert a single X for the second value when it is a completely empty string?</p>
  
  <pre><code>USE Test;
  GO
  
  SET ANSI_PADDING ON;
  GO
  
  CREATE TABLE BlankTest
  (
      Value char(5) NOT NULL
  );
  GO
  
  INSERT INTO BlankTest (
      Value
  ) VALUES (
      'test'
  );
  GO
  
  INSERT INTO BlankTest (
      Value
  ) VALUES (
      ''
  );
  GO
  
  SELECT REPLACE(Value, ' ', 'X'), LEN(Value)
  FROM BlankTest;
  GO
  
  DROP TABLE BlankTest;
  </code></pre>