USE [Database]

IF OBJECT_ID('[Functions].[fill_CHAR_128]') IS NOT NULL
  DROP FUNCTION [Functions].[fill_CHAR_128];
GO

CREATE FUNCTION [Functions].[fill_CHAR_128](
  @string AS NVARCHAR(128),
  @symbol AS NVARCHAR,
  @width  AS INT
)
RETURNS NVARCHAR(128) AS
BEGIN
  RETURN CONCAT(REPLICATE(@symbol, @width - LEN(@string)), @string);
END
GO