What is the best way to append spaces at the end of a char variable in SQL Server? I have found 3 ways. Any ideas which one is better? Here I am trying to pad 2 spaces at the end of FOO
1)
declare @var char(5)
set @var = convert(char(5),'FOO')
2)
declare @var char(5)
set @var = cast('FOO' AS char(5))
3)
declare @var char(5)
set @var = 'FOO'
what is the difference between each of them?
When I have to parse huge data which option will be quicker and efficient taking less memory?