SQL Server Bulk Copy console app with added Backupability
This was forked from AppHarbor's original as I needed to run the script as a scheduled task to do nightly backups to our local Sql Server. I needed those backups to go onto an external drive so there is an option for that: backupFilePath which you can set to any path or leave blank to use the SQL Server default. You should set periodicBackup to true if you want to create new databases each time with the date appended onto the filename.
I also added an App.config for the settings as it's more convenient for me to manage it this way.
Please note you need Microsoft.SqlServer.SmoExtended.dll which you can find if you search for it on your machine hopefully. Mine has a different name so I renamed it back to Microsoft.SqlServer.SmoExtended and put it in the lib along with the others.
From the original project: For trusted connections, just skip both the username and password parameters.
Use option --checkidentityexists if you are getting sql exceptions ([table] does not contain an identity column.) when trying to clear tables without identity columns.
The SMO dlls cannot be distributed with the source code due to licensing restrictions. You need to get Microsoft SQL Server 2008 R2 Shared Management Objects from the Microsoft Download Center. Place
Microsoft.SqlServer.SqlEnum.dll in the