In this case we want to extract a two digit month for the past month !

RIGHT('00' + CONVERT(NVARCHAR(2), DATEPART(MONTH, dateadd(m,-1,GETDATE()))), 2)

Thanks to my friend Louis on this one that saved me !

Tagged with:  

MySQL Query to extract database size

On 11 December 2013, in IT Procedure, Mysql, Programming, by Himselff
SELECT table_schema , sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema ;
Tagged with: