C# Class PiroPiro.DbCleanup.SqlServer.SqlAttach

Restores a SQL database by detaching, overwriting .mdf file and attaching again. (usually faster than a full SQL Restore)
Inheritance: SqlServerStrategy
Afficher le fichier Open project: benjamine/PiroPiro

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
DoExecute ( ) : void

Private Methods

Méthode Description
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

Method Details

DetachOverwriteAttach() public static méthode

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
Résultat void

DoExecute() protected méthode

protected DoExecute ( ) : void
Résultat void

PrepareNextCopyAsync() public static méthode

public static PrepareNextCopyAsync ( string filename ) : void
filename string
Résultat void

SqlAttach() public méthode

public SqlAttach ( Configuration configuration = null ) : System
configuration Configuration
Résultat System