RPAD Function - Netezza to SQL Server Migration

RPAD function returns the string right-padded to the specified number of characters. RPAD accepts 2 or 3 parameters in Netezza.

SQL Server does not have RPAD function but you can use expressions with LEFT and REPLICATE functions to implement RPAD, see examples below.

Netezza:

  -- Pad string with blanks (default) 
  SELECT RPAD('abc', 7);
  #  abc    (4 blanks follow)
 
  -- Pad string with * 
  SELECT RPAD('abc', 7, '*');
  # abc****

SQL Server:

  -- Pad string with blanks 
  SELECT LEFT('abc' + REPLICATE(' ', 7), 7);
  # abc    (4 blanks follow)
 
  -- Pad string with * 
  SELECT LEFT('abc' + REPLICATE('*', 7), 7);
  # abc****

For more information, see Netezza to SQL Server Migration.