public CreateDatabaseDeploymentStep(DbProjectInfo projectInfo, DatabaseServer databaseServer, IDbManagerFactory dbManagerFactoryFactory)
        {
            Guard.NotNull(projectInfo, "projectInfo");
              Guard.NotNull(databaseServer, "databaseServer");
              Guard.NotNull(dbManagerFactoryFactory, "dbManagerFactory");

              _projectInfo = projectInfo;
              _databaseServer = databaseServer;
              _dbManagerFactory = dbManagerFactoryFactory;
        }
        public PublishDatabaseDeploymentStep(DbProjectInfo dbProjectInfo, DatabaseServer databaseServer, string artifactsDirPath, IMsSqlDatabasePublisher databasePublisher)
        {
            Guard.NotNull(dbProjectInfo, "dbProjectInfo");
              Guard.NotNull(databaseServer, "databaseServer");
              Guard.NotNull(artifactsDirPath, "artifactsDirPath");
              Guard.NotNull(databasePublisher, "databasePublisher");

              _dbProjectInfo = dbProjectInfo;
              _databaseServer = databaseServer;
              _artifactsDirPath = artifactsDirPath;
              _databasePublisher = databasePublisher;
        }
        private IDbScriptRunner GetScriptRunner(bool isTransactional, string databaseServerMachineName, string dbName, DatabaseServer databaseServers)
        {
            string argumentsSqlCmd = "";
              if (databaseServers != null)
              {
            argumentsSqlCmd = string.Join(" ",
            databaseServers.SqlPackageVariables.Select(
              kv => string.Format(" /v {0}=\"{1}\"", kv.Key, kv.Value)));
              }

              IDbScriptRunner scriptRunner =
              _dbScriptRunnerFactory.CreateDbScriptRunner(isTransactional, databaseServerMachineName, dbName, argumentsSqlCmd);

              if (scriptRunner == null)
              {
            throw new DeploymentTaskException(string.Format("Can not create script runner for specified database server machine: '{0}'.", databaseServerMachineName));
              }

              return scriptRunner;
        }