A data-tier application (DAC) is a logical database management entity that defines all SQL Server objects - such as tables, views, and instance objects - associated with a user's database. It is a self-contained unit of SQL Server database deployment that enables data-tier developers and DBAs to package SQL Server objects into a portable artifact called a DAC package, or .dacpac file. See more
- .NET Core 2.1+ runtime installed
dotnet tool install --global Dacpac.Tool
- Use case
Multi tenant database, your have same schema for multiple client on database server
- Windows autentication (SSPI)
dotnet dacpac publish --dacpath=C:\artifact\db\ --server=mydatabase.server.contoso.com --databasenames='client1;client2;client3;client4'
- Specific User authentication
dotnet dacpac publish --dacpath=C:\artifact\db\ --server=mydatabase.server.contoso.com --databasenames='client1;client2;client3;client4' --userId=useWithPersmissionForUpdate --password=123455
- Parameters
Name | Description | Default |
---|---|---|
dacpath | Directory where the dacpac file is stored | Directory that the tool is running |
databasenames | The names of databases that need to be updated | It's requerid not have default |
namenattern | Pattern for search file | *.dacpac |
UseSspi | Indicates that the windows user should be used | true |
userId | Database user Need permissions for schema change | carioca |
password | The password from 'userid' | IFromBrazilian |