private static void ExecuteSQL(SqlConnection connection, SqlTransaction transaction, string sql)
{
sql = sql.Trim();
if (sql == "") return;
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand(sql, connection);
command.Transaction = transaction;
command.CommandTimeout = 300;
try
{
command.ExecuteNonQuery();
}
catch (System.Data.SqlClient.SqlException sqlexp)
{
if ((sqlexp.Number == 1779) && sql.StartsWith("--PRIMARY KEY FOR TABLE"))
{
//Ignore this error
return;
}
else if ((sqlexp.Number == 1781) && sql.StartsWith("--DEFAULTS FOR TABLE"))
{
//Ignore this error
return;
}
else
throw;
}
catch (Exception ex)
{
throw;
}
}