This article guides Malwarebytes Endpoint Security business customers on how to export client threat data to a CSV file for the purpose of generating reports. Bulk copy program utility (bcp) is a command utility that is installed along with SQL Management Studio. This utility exports data out of an SQL Server database instance.
For more information, refer to Microsoft's support article Bulk Copy Utility (bcp).
Below are sample queries used to export the system and security logs out to a CSV file.
- To name the output file, replace Test with a different file name.
- The blue text represents the machine's name and SQL database instance name. Change the command to your configuration, using "." as a local name, or a hostname/FQDN then include the default or named SQL database instance.
SQL Express sample query
- bcp "SELECT * FROM SCDB.dbo.TBL_ClientSecurityLog" queryout C:\Test.csv -c -t, -T -S .\SQLEXPRESS
- bcp "SELECT * FROM SCDB.dbo.TBL_ClientSystemLog" queryout C:\Test.csv -c -t, -T -S .\SQLEXPRESS
SQL Server sample query
- bcp "SELECT * FROM SCDB.dbo.TBL_ClientSecurityLog" queryout C:\Test.csv -c -t, -T -S FQDN\INSTANCE
- bcp "SELECT * FROM SCDB.dbo.TBL_ClientSystemLog" queryout C:\Test.csv -c -t, -T -S FQDN\INSTANCE