select country + replicate(' ', 56 - len(country)) + currency_code from dbo.currency order by country;
declare @MaxLen intselect @MaxLen = MAX(len(country)) + 2 from currencydeclare @sql varchar(max)select @sql = 'select CAST(country as CHAR(' + cast(@MaxLen as varchar(3)) + ')) + currency_code from currency order by country'exec (@sql)