コード例 #1
0
ファイル: Remaker.cs プロジェクト: elvisdelima/RemakeDatabase
 public Remaker(RemakeConfiguration config)
 {
     this.config = config;
     sqlCheckIfDatabaseExist = string.Format(@"SELECT COUNT(name) as total FROM master.dbo.sysdatabases dbs WHERE dbs.name = '{0}'", config.Database);
     sqlCloseConnections = string.Format(@"ALTER DATABASE {0} SET SINGLE_USER WITH ROLLBACK IMMEDIATE", config.Database);
     sqlDropDatabase = string.Format(@"DROP DATABASE [{0}]", config.Database);
     sqlCreateDatabase = string.Format(@"CREATE DATABASE [{0}]", config.Database);
     connectionString = config.ServerConnectionString;
     stopwatch = new Stopwatch();
 }
コード例 #2
0
 public Remaker(RemakeConfiguration config)
 {
     this.config             = config;
     sqlCheckIfDatabaseExist = string.Format(@"SELECT COUNT(name) as total FROM master.dbo.sysdatabases dbs WHERE dbs.name = '{0}'", config.Database);
     sqlCloseConnections     = string.Format(@"ALTER DATABASE {0} SET SINGLE_USER WITH ROLLBACK IMMEDIATE", config.Database);
     sqlDropDatabase         = string.Format(@"DROP DATABASE [{0}]", config.Database);
     sqlCreateDatabase       = string.Format(@"CREATE DATABASE [{0}]", config.Database);
     connectionString        = config.ServerConnectionString;
     stopwatch = new Stopwatch();
 }