I'm using following line of code in SQL:

REPLACE(CONVERT(VARCHAR(11),getdate(),106), ' ','-') 

to convert given date to MMM-DD-YYYY format, this code is working perfectly fine if current date is more that 10th.

But I'm getting error when its tries to convert single digit date, e.g when I'm converting date 9 jan 2014. It is converted to Jan--9-2014.

Which is actually wrong as its contain one extra -.

Please help me to resolve this issue.