This content is part of a third party addin that is not supported by the Cake project.
For more information about this project, please visit
https://github.com/AMVSoftware/Cake.SqlServer.
Summary
Contains functionality to backup and restore SQL Server database
General
BackupDatabase |
Backup an existing database to a file.
Addin from Cake |
CreateBacpacFile |
Creates a bacpac file for easy database backuping.
Addin from Cake |
CreateDatabase |
Creates an empty database. If database with this name already exists, throws a SqlException.
Cake.SqlServer.SqlServerAliases.CreateDatabaseIfNotExists(Cake.Core.ICakeContext,System.String,System.String) if you would like to check if database already exists.
Addin from Cake |
CreateDatabase |
Creates an empty database. If database with this name already exists, throws a SqlException.
Allows to specify primary and log files location.
Addin from Cake |
Create |
Creates an empty database if another database with the same does not already exist.
Addin from Cake |
Create |
Creates an empty database if another database with the same does not already exist.
Addin from Cake |
DatabaseExists |
Test if the database exists
Addin from Cake |
Drop |
First drops, then recreates the database
Addin from Cake |
Drop |
First drops, then recreates the database
Addin from Cake |
DropDatabase |
Drops database. Before dropping the DB, database is set to be offline, then online again.
This is to be sure that there are no live connections, otherwise the script will fail.
Also if the database does not exist - it will not do anything.
Addin from Cake |
ExecuteSqlCommand |
Execute any SQL command.
Addin from Cake |
ExecuteSqlCommand |
Execute any SQL command.
Addin from Cake |
ExecuteSqlFile |
Reads SQL commands from a file and executes them.
Addin from Cake |
ExecuteSqlFile |
Reads SQL commands from a file and executes them.
Addin from Cake |
ExtractDacpacFile |
Extracts a dacpac file to a database package.
Addin from Cake |
Local |
Creates a server instance and starts the server.
The version number defaults to the version of the SqlLocalDB utility
Addin from Cake |
Local |
Creates a server instance and starts the server.
Addin from Cake |
Local |
Deletes the LocalDB instance
Addin from Cake |
LocalDbStartInstance |
Starts the LocalDB instance. Instance must exist before you can start it.
Addin from Cake |
LocalDbStopInstance |
Stops the LocalDB instance.
Addin from Cake |
OpenSqlConnection |
Opens a new System.Data.SqlClient.SqlConnection with the given connection string.
Addin from Cake |
PublishDacpacFile |
Publish a dacpac file to a database.
Addin from Cake |
RestoreBacpac |
Restores a bacpac file into a database.
NB: there must be no database with the name you provide. Otherwise exception will be thrown. Addin from Cake |
RestoreSqlBackup |
Restores a database from a backup file.
Addin from Cake |
RestoreSqlBackup |
Restores a database from a backup file.
Addin from Cake |
SetSqlCommandTimeout |
Sets the CommandTimeout property for all SqlCommands used internally
Addin from Cake |