DAC Framework Client Side Tools Reference

The EXE provided here serves as a reference implementation for how to call the DAC Framework's public APIs. Before you can use the provided EXE you must install the required assemblies.

Required Assemblies
The assembly list is kept on the Required Assemblies Links page.

Source Code
The source code for the client side tools is kept on this page.

Sample Output
Microsoft (R) DAC Import Export Sample version
Copyright (C) Microsoft Corporation. All rights reserved.

Command Line Parameters:
-H[elp] | -? Show this help text.
-X[export] Perform an export action.
-SX[SelectiveExport] Perform a selective export action.
-I[mport] Perform an import action.
-D[atabase] <database> Database name to perform the action on.
-F[ile] <filename> Name of the backup file.
-SXF[SELECTIVEEXPORTFILENAME] <filename> Name of the file that contains the tables names in xml format for selective export.
-S[erver] <servername> SQL Server Name and instance.
-E Use Windows authentication
(not valid for SQL Azure)
-U[ser] User name for SQL authentication.
-P[assword] Password for SQL authentication.
-DROP Drop a database and remove the DAC registration.(*2)
-EDITION <business|web> SQL Azure edition to use during database creation.(*4)
-SIZE <1> SQL Azure database size in GB.(*4)
-N Encrypt Connection using SSL.
-T Force TrustServerCertificate(*6)
-EXTRACT Extract database schema only.
-DEPLOY Deploy schema only to database.

Export a database to a bacpac using Windows Auth:
DacImportExportCli -S myserver -E -B -D northwind -F northwind.bacpac -X

Export selected tables from a database to a bacpac using Windows Auth:
DacImportExportCli -S myserver -E -B -D northwind -F northwind.bacpac -SX -SXF <selectiveExportInputFile.xml>

Import a bacpac to a database using Windows Auth:
DacImportExportCli -S myserver -E -D nw_restored -F northwind.bacpac -I

Import a bacpac to SQL Azure with options:
DacImportExportCli -S myazure -U azureuser -P azurepwd -D nw_restored -F northwind.bacpac -I -EDITION web -SIZE 5 -N

Drop both database and DAC registration:
DacImportExportCli -S myserver -E -D nw_restored -DROP

*Notes and caveats:
1. On import the database must not exist. A new database is
always created. SQL Azure uses system edition defaults if not set.
2. DROP is very aggressive. It will attempt to remove a database
that is not registered as a DAC. It will also remove DAC
registration missing a database. Use -D to specify the database.
3. Databases can use this tool only if they contain
SQL 2008 R2 DAC supported objects and types.
4. Choose the SQL Azure options desired, this may impact billing.
(Only valid against SQL Azure)
5. See SQL Server Books Online Topic:
Understanding Data-tier Applications
for more information about DAC.
6. Used to resolve connection issues when receiving exception:
'certificate's CN name does not match the passed value'
See SQL Server Books Online Topic: TrustServerCertificate

Common Errors

Could not locate the assembly errors

Last edited Jul 20, 2012 at 7:50 PM by Shamitha_Reddy, version 13


No comments yet.