select CAST(DATEPART(YEAR,GETDATE()) AS VARCHAR(4))
+'-'+CAST(DATEPART(MONTH,GETDATE()) AS VARCHAR(2))
+'-'+CAST(DATEPART(DAY,GETDATE()) AS VARCHAR(2))
SELECT REPLACE(CONVERT( char(10),CAST('2011-06-05 8:00:00' AS DATETIME),120),N'-0','-')