C# Класс PiroPiro.DbCleanup.SqlServer.SqlAttach

Restores a SQL database by detaching, overwriting .mdf file and attaching again. (usually faster than a full SQL Restore)
Наследование: SqlServerStrategy
Показать файл Открыть проект

Открытые методы

Метод Описание
DetachOverwriteAttach ( string databaseName, string serverName, bool useAsyncCopy = true, string sourceMdfFileSuffix = ".testData", string userName = null, string password = null ) : void

Detachs a database, overwrites its .mdf file, and attachs it again (a faster replacement for a SQL Restore)

PrepareNextCopyAsync ( string filename ) : void
SqlAttach ( Configuration configuration = null ) : System

Защищенные методы

Метод Описание
DoExecute ( ) : void

Приватные методы

Метод Описание
Attach ( string databaseName, string serverName, string userName, string password, string mdfFile ) : void
Detach ( string databaseName, string serverName, string userName = null, string password = null ) : void
GetDatabaseFiles ( string databaseName, string serverName, string &mdfFile, string &logFile, string userName = null, string password = null ) : void
GrantFullControl ( string filename, string user ) : void
LocalPathToUnc ( string serverName, string fullpath ) : string
OverwriteMdfFile ( string serverName, string mdfFile, string logFile, bool useAsyncCopy = true, string sourceMdfFileSuffix = ".testData" ) : void

Описание методов

DetachOverwriteAttach() публичный статический Метод

Detachs a database, overwrites its .mdf file, and attachs it again (a faster replacement for a SQL Restore)
public static DetachOverwriteAttach ( string databaseName, string serverName, bool useAsyncCopy = true, string sourceMdfFileSuffix = ".testData", string userName = null, string password = null ) : void
databaseName string
serverName string
useAsyncCopy bool
sourceMdfFileSuffix string a suffix to add to mdf target filename to obtain the source filename (by default .testData)
userName string
password string
Результат void

DoExecute() защищенный Метод

protected DoExecute ( ) : void
Результат void

PrepareNextCopyAsync() публичный статический Метод

public static PrepareNextCopyAsync ( string filename ) : void
filename string
Результат void

SqlAttach() публичный Метод

public SqlAttach ( Configuration configuration = null ) : System
configuration Configuration
Результат System