示例#1
0
        protected void RestoreDropObjects(string type, string[] names, VEBooleanDelegateString dropAndExists)
        {
            foreach (string name in names)
            {
                Status("Dropping " + type + ": " + name);
                dropAndExists(name);
            }

            Status("");
        }
示例#2
0
        protected void RestoreCreateObject(string type, string text, string sourceSchema, string targetSchema, string ownerObject, VEBooleanDelegateString dropAndExists, ref int size, ref int count)
        {
            int length = text.Length;

            if (text.Substring(0, length > 100 ? 100 : length).ToLower().IndexOf("create ") >= 0)
            {
                if (sourceSchema.Length > 0)
                {
                    text = text.Replace(sourceSchema, targetSchema).Replace(sourceSchema.ToLower(), targetSchema);
                }

                targetCmd.Execute(text);

                if (dropAndExists(ownerObject))
                {
                    Memo("Memo", string.Format("Restore Schema {0}: {1, 7:n0} Bytes - {2} Restored", type, length, ownerObject));
                    size += length;
                    count++;
                }
                else
                {
                    Memo("Memo", string.Format("Restore Schema {0}: {1, 7} {2} NOT CREATED {3}",
                                               type, "ERROR", ownerObject,
                                               SQLHandler.HasErrors ? " - See below\r\n" + SQLHandler.Errors : ""));
                }
            }
        }