How to do in SqlServer so that the result comes with zero left?
In mysql it would look like this:
select lpad(mes,2,0 ) as 'mes', ano from tab_qualquer;
How do you do something equivalent on Sql Server?
I've already searched the link and I did so:
select distinct
right(replicate('0',2) + mes,2) as mes,
ano
from tabela
and gave the following error:
Error code 0, SQL state 22019: Unrecognized SQL escape 'year' at line position 702. Line 1, column 1