Skip to content

Commit f49d726

Browse files
Added usage documentation
1 parent 5926149 commit f49d726

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

docs/tools/sqlpackage.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,29 @@ The **SqlPackage.exe** command line allows you to specify these actions along wi
3838
```
3939
SqlPackage {parameters}{properties}{SQLCMD Variables}
4040
```
41-
41+
42+
### Usage Examples
43+
44+
**Generating a comparison between databases using .dacpac files with a SQL script output.**
45+
46+
Start by creating a .dacpac file of your latest database changes
47+
48+
```
49+
sqlpackage.exe /TargetFile:"C:\sqlpackageoutput\output_current_version.dacpac" /Action:Extract /SourceServerName:"." /SourceDatabaseName:"Contoso.Database"
50+
```
51+
52+
Create a .dacpac file of your database target (that has no changes):
53+
54+
```
55+
sqlpackage.exe /TargetFile:"C:\sqlpackageoutput\output_target.dacpac" /Action:Extract /SourceServerName:"." /SourceDatabaseName:"Contoso.Database"
56+
```
57+
58+
Create a SQL Script that generates the differences of two .dacpac files:
59+
60+
```
61+
sqlpackage.exe /Action:Script /SourceFile:"C:\sqlpackageoutput\output_current_version.dacpac" /TargetFile:"C:\sqlpackageoutput\output_target.dacpac" /TargetDatabaseName:"Contoso.Database" /OutputPath:"C:\sqlpackageoutput\output.sql"
62+
```
63+
4264
### Help for the Extract action
4365

4466
|Parameter|Short Form|Value|Description|

0 commit comments

Comments
 (0)