Пример #1
0
 private void runScripts(string[] files, Connection conn, string dbName)
 {
     foreach (string sql in files)
     {
         Console.WriteLine(sql);
         totalScripts++;
         try
         {
             ScriptExecute exec = new ScriptExecute(sql, dbName, conn);
             if (exec.success == false)
             {
                 failedScripts.Add(exec);
             }
         }
         catch (Exception e)
         {
             Console.WriteLine(e.InnerException);
         }
     }
 }
Пример #2
0
 private void runScripts(string[] files, Database db)
 {
     foreach (string sql in files)
     {
         Console.WriteLine(sql);
         totalScripts++;
         try
         {
             ScriptExecute exec = new ScriptExecute(sql, db);
             if (exec.success == false) failedScripts.Add(exec);
         }
         catch (Microsoft.SqlServer.Management.Smo.FailedOperationException e)
         {
             Console.WriteLine(e.InnerException);
         }
     }
 }