23 June 2019

Want to know your MySQL database size?

Well, you can try the script below:

Select
table_schema As "Database Name",
Round(Sum(data_length + index_length) / 1024 / 1024, 2) As "Database Size in MB"
From information_schema.Tables
Where table_schema = 'xxxxx'
Group By table_schema
Order By table_schema;

It takes years to output data via Microsoft SQL Server BCP (Bulk Copy Program utility)?

If you are using Microsoft SQL Server BCP (Bulk Copy Program) utility, or a.k.a. XPShellCmd, and you found that your scripts take forever to execute.

Solution:

a). Always make sure your Select statement comes with NoLock for each tables.