public void execute_file() { var connection_string = "server=devsql01; uid=schools2; pwd=schools_1; database=ese"; var file_path = @"c:\code\github\roy\roy.tests\examples\1 one.sql"; var script = new sql_script(connection_string); script.execute(file_path); }
public void execute_directory() { var connection_string = "server=devsql01; uid=schools2; pwd=schools_1; database=ese"; var directory_path = @"c:\code\github\roy\roy.tests\examples\"; var script = new roy.data.sql_script(connection_string); script.execute_directory(directory_path); }
public void execute_files(string directory) { var file_paths = Directory.GetFiles(directory); var sql_files = new List<FileInfo>(); foreach (var file_path in file_paths) { var file = new FileInfo(file_path); if (file.Extension == "sql") { sql_files.Add(file); } } sql_files = sql_files.OrderBy(f => f.Name).ToList(); var script = new sql_script(to); foreach (var sql_file in sql_files) { script.execute(sql_file.FullName); } }
public q(string from_connection_string, string to_connection_string) { from = from_connection_string; to = to_connection_string; script = new sql_script(to); }