Lpad & Rpad in sqlserver
DECLARE @vstr VARCHAR(3)
SET @vstr = 'paddig'
SELECT
RIGHT(REPLICATE(' ',100) + @test ,10) AS RPAD,
LEFT(@test + REPLICATE(' ',100) ,10) AS LPAD
or
select RIGHT(REPLICATE(' ',100) + 'padstr' ,10) AS RPAD + LEFT('padstr' + REPLICATE(' ',100) ,10) AS LPAD
DECLARE @vstr VARCHAR(3)
SET @vstr = 'paddig'
SELECT
RIGHT(REPLICATE(' ',100) + @test ,10) AS RPAD,
LEFT(@test + REPLICATE(' ',100) ,10) AS LPAD
or
select RIGHT(REPLICATE(' ',100) + 'padstr' ,10) AS RPAD + LEFT('padstr' + REPLICATE(' ',100) ,10) AS LPAD