Copy data between Microsoft SQL Server databases.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Add license Jan 30, 2014
README.markdown added readme comment for when SMO is already installed Jun 19, 2013


SQL Server Bulk Copy console app

This is a C# console app that copies data between Microsoft SQL Server databases. Example use:

AppHarbor.SqlServerBulkCopy.exe --srcusername=dbxx --srcpassword=srcpassword --srcdatabasename=dbxx --dstserver=.\SQLEXPRESSADV --dstusername=dbyy --dstpassword=dstpassword --dstdatabasename=dbyy --ignoretables=TableToIgnore --cleardstdatabase

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.ConnectionInfo.dll, Microsoft.SqlServer.Management.Sdk.Sfc.dll, Microsoft.SqlServer.Smo.dll and Microsoft.SqlServer.SqlEnum.dll in the lib\SqlServerManagementObjects directory.

If you have the SDK already installed, you can find all the necessary DLLs in the directory:

C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies