SQL script to convert data to Approval format

Added Status before and after running script
Added query conditions to limit the databases listed
This commit is contained in:
Rich
2012-01-23 18:21:06 +00:00
parent c5e95ca801
commit 83f9e1cc75
3 changed files with 3013 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -357,12 +357,14 @@ namespace DataLoader
private void RunScript(string scriptName, string dbName)
{
Status = String.Format("Running Script '{0}'", scriptName);
string script = GetScript(scriptName);
script=script.Replace("{DBName}", MySettings.DBName);
script=script.Replace("{DBPath}", MySettings.DBPath);
SQLScriptRunner ssr = new SQLScriptRunner(script, MySettings.ConnectionString.Replace("{DBName}", dbName));
ssr.InfoMessage += new SQLScriptRunnerEvent(ssr_InfoMessage);
ssr.Run();
Status = String.Format("Script '{0}' Complete", scriptName);
}
private void Backup(string suffix)
{

View File

@@ -108,7 +108,7 @@ namespace VEPROMS.CSLA.Library
SqlConnection cn = new SqlConnection(tmp);
cn.Open();
// SqlDataAdapter da = new SqlDataAdapter("select name from sysdatabases where name like 'VEP%' order by name", cn);
SqlDataAdapter da = new SqlDataAdapter("select name,case when object_id(name + '..Revisions') is not null then 'Approval' when object_id(name + '..ContentAudits') is not null then 'Change Manager' else 'Original' end functionality from sysdatabases where name like 'VEP%' order by name", cn);
SqlDataAdapter da = new SqlDataAdapter("select name, case when object_id(name + '..Items') is null then 'Not PROMS' when object_id(name + '..Revisions') is not null then 'Approval' when object_id(name + '..ContentAudits') is not null then 'Change Manager' else 'Original' end functionality from sysdatabases where name not in ('master','model','msdb','temp') order by name", cn);
DataSet ds = new DataSet();
da.Fill(ds);
cn.Close();