当前位置: 首页>>代码示例>>C#>>正文


C# SQLScriptList.Add方法代码示例

本文整理汇总了C#中SQLScriptList.Add方法的典型用法代码示例。如果您正苦于以下问题:C# SQLScriptList.Add方法的具体用法?C# SQLScriptList.Add怎么用?C# SQLScriptList.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SQLScriptList的用法示例。


在下文中一共展示了SQLScriptList.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToSqlDiff

        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList list = new SQLScriptList();
            if (this.Status != Enums.ObjectStatusType.OriginalStatus)
                RootParent.ActionMessage.Add(this);
          
            if (this.HasState(Enums.ObjectStatusType.DropStatus))
                list.Add(Drop());
            if (this.HasState(Enums.ObjectStatusType.CreateStatus))
                list.Add(Create());
            if (this.HasState(Enums.ObjectStatusType.AlterStatus))
            {
                if (this.HasState(Enums.ObjectStatusType.RebuildDependenciesStatus))
                    list.AddRange(RebuildDependencys());

                if (!this.GetWasInsertInDiffList(Enums.ScripActionType.DropFunction))
                {
                    if (this.HasState(Enums.ObjectStatusType.RebuildStatus))
                    {
                        list.Add(Drop());
                        list.Add(Create());
                    }
                    if (this.HasState(Enums.ObjectStatusType.AlterBodyStatus))
                    {
                        int iCount = DependenciesCount;
                        list.Add(ToSQLAlter(), iCount, Enums.ScripActionType.AlterFunction);
                    }
                }
            }
            return list;
        }
开发者ID:elayaraja007,项目名称:sql-dbdiff,代码行数:31,代码来源:Function.cs

示例2: ToSqlDiff

 public override SQLScriptList ToSqlDiff()
 {
     SQLScriptList list = new SQLScriptList();
     if (this.Status == Enums.ObjectStatusType.DropStatus)
         list.Add(Drop());
     if (this.Status == Enums.ObjectStatusType.CreateStatus)
         list.Add(Create());
     if (this.HasState(Enums.ObjectStatusType.AlterStatus))
         list.AddRange(Rebuild());
     if (this.HasState(Enums.ObjectStatusType.DisabledStatus))
         list.Add(this.ToSQLEnabledDisabled(), 0, Enums.ScripActionType.EnabledTrigger);
     return list;
 }
开发者ID:mi-tettamanti,项目名称:opendbiff,代码行数:13,代码来源:Trigger.cs

示例3: ToSqlDiff

        /// <summary>
        /// Devuelve el schema de diferencias del Schema en formato SQL.
        /// </summary>
        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList listDiff = new SQLScriptList();

            if (this.Status == Enums.ObjectStatusType.DropStatus)
            {
                listDiff.Add(ToSqlDrop(), 0, Enums.ScripActionType.DropSchema);
            }
            if (this.Status == Enums.ObjectStatusType.CreateStatus)
            {
                listDiff.Add(ToSql(), 0, Enums.ScripActionType.AddSchema);
            }
            return listDiff;
        }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:17,代码来源:Schema.cs

示例4: ToSqlDiff

        /// <summary>
        /// Devuelve el schema de diferencias del Schema en formato SQL.
        /// </summary>
        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList list = new SQLScriptList();
            if (this.Status != Enums.ObjectStatusType.OriginalStatus)
                RootParent.ActionMessage.Add(this);

            if (this.HasState(Enums.ObjectStatusType.DropStatus))
                list.Add(Drop());
            if (this.HasState(Enums.ObjectStatusType.CreateStatus))
                list.Add(Create());
            if (this.Status == Enums.ObjectStatusType.AlterStatus)
                list.Add(ToSQLAlter(), 0, Enums.ScripActionType.AlterProcedure);
            return list;
        }
开发者ID:facingup,项目名称:opendbdiff,代码行数:17,代码来源:StoreProcedure.cs

示例5: ToSqlDiff

        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList listDiff = new SQLScriptList();

            if (this.Status == Enums.ObjectStatusType.DropStatus)
                listDiff.Add(ToSqlDrop(), 0, Enums.ScripActionType.DropAssemblyFile);
            if (this.Status == Enums.ObjectStatusType.CreateStatus)
                listDiff.Add(ToSqlAdd(), 0, Enums.ScripActionType.AddAssemblyFile);
            if (this.HasState(Enums.ObjectStatusType.AlterStatus))
            {
                listDiff.Add(ToSqlDrop(), 0, Enums.ScripActionType.DropAssemblyFile);
                listDiff.Add(ToSqlAdd(), 0, Enums.ScripActionType.AddAssemblyFile);
            }
            return listDiff;
        }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:15,代码来源:AssemblyFile.cs

示例6: ToSqlDiff

        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList list = new SQLScriptList();

            if (this.HasState(Enums.ObjectStatusType.DropStatus))
                list.Add(Drop());
            if (this.HasState(Enums.ObjectStatusType.CreateStatus))
                list.Add(Create());
            if (this.Status == Enums.ObjectStatusType.AlterStatus)
            {
                list.AddRange(Rebuild());
            }
            list.AddRange(this.ExtendedProperties.ToSqlDiff());
            return list;
        }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:15,代码来源:CLRStoreProcedure.cs

示例7: ToSqlDiff

        /// <summary>
        /// Devuelve el schema de diferencias del Schema en formato SQL.
        /// </summary>
        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList listDiff = new SQLScriptList();

            if (this.Status == Enums.ObjectStatusType.DropStatus)
            {
                listDiff.AddRange(ToSQLUnBindAll());
                listDiff.Add(Drop());
            }
            if (this.Status == Enums.ObjectStatusType.CreateStatus)
                listDiff.Add(Create());
            if (this.Status == Enums.ObjectStatusType.AlterStatus)
            {
                listDiff.AddRange(ToSQLUnBindAll());
                listDiff.AddRange(Rebuild());
            }
            return listDiff;
        }
开发者ID:pclancy,项目名称:ODBX,代码行数:21,代码来源:Rule.cs

示例8: ToSQLUnBindAll

 private SQLScriptList ToSQLUnBindAll()
 {
     SQLScriptList listDiff = new SQLScriptList();
     Hashtable items = new Hashtable();
     List<UserDataType> useDataTypes = ((Database)this.Parent).UserTypes.FindAll(item => { return item.Rule.FullName.Equals(this.FullName); });
     foreach (UserDataType item in useDataTypes)
     {
         foreach (ObjectDependency dependency in item.Dependencys)
         {
             Column column = ((Database)this.Parent).Tables[dependency.Name].Columns[dependency.ColumnName];
             if ((!column.IsComputed) && (column.Status != Enums.ObjectStatusType.CreateStatus))
             {
                 if (!items.ContainsKey(column.FullName))
                 {
                     listDiff.Add("EXEC sp_unbindrule '" + column.FullName + "'\r\nGO\r\n", 0, Enums.ScripActionType.UnbindRuleColumn);
                     items.Add(column.FullName, column.FullName);
                 }
             }
         }
         if (item.Rule.Status != Enums.ObjectStatusType.CreateStatus)
             listDiff.Add("EXEC sp_unbindrule '" + item.FullName + "'\r\nGO\r\n", 0, Enums.ScripActionType.UnbindRuleType);
     }
     return listDiff;
 }
开发者ID:elayaraja007,项目名称:sql-dbdiff,代码行数:24,代码来源:Rule.cs

示例9: ToSqlDiff

        /// <summary>
        /// Devuelve el schema de diferencias del Schema en formato SQL.
        /// </summary>
        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList list = new SQLScriptList();

            if (this.Status == Enums.ObjectStatusType.DropStatus)
            {
                list.Add(ToSqlDrop(), 0, Enums.ScripActionType.DropXMLSchema);
            }
            if (this.Status == Enums.ObjectStatusType.CreateStatus)
            {
                list.Add(ToSql(), 0, Enums.ScripActionType.AddXMLSchema);
            }
            if (this.Status == Enums.ObjectStatusType.AlterStatus)
            {
                list.AddRange(ToSQLChangeColumns());
                list.Add(ToSqlDrop() + ToSql(), 0, Enums.ScripActionType.AddXMLSchema);
            }
            return list;
        }
开发者ID:mi-tettamanti,项目名称:opendbiff,代码行数:22,代码来源:XMLSchema.cs

示例10: ToSqlDiff

        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList list = new SQLScriptList();
            if (this.Status != Enums.ObjectStatusType.OriginalStatus)
                RootParent.ActionMessage[Parent.FullName].Add(this);

            if (this.HasState(Enums.ObjectStatusType.DropStatus))
            {
                if (this.Parent.Status != Enums.ObjectStatusType.RebuildStatus)
                    list.Add(Drop());
            }
            if (this.HasState(Enums.ObjectStatusType.CreateStatus))
                list.Add(Create());
            if (this.HasState(Enums.ObjectStatusType.AlterStatus))
            {
                list.Add(Drop());
                list.Add(Create());
            }
            if (this.HasState(Enums.ObjectStatusType.DisabledStatus))
            {
                list.Add(this.ToSQLEnabledDisabled(), ((Table)Parent).DependenciesCount, Enums.ScripActionType.AlterConstraint);
            }
            /*if (this.Status == StatusEnum.ObjectStatusType.ChangeFileGroup)
            {
                list.Add(this.ToSQLDrop(this.Index.FileGroup), ((Table)Parent).DependenciesCount, actionDrop);
                list.Add(this.ToSQLAdd(), ((Table)Parent).DependenciesCount, actionAdd);
            }*/
            return list;
        }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:29,代码来源:Constraint.cs

示例11: ToSqlDiff

        public override SQLScriptList ToSqlDiff(List<ISchemaBase> schemas)
        {
            var isAzure10 = this.Info.Version == DatabaseInfo.VersionTypeEnum.SQLServerAzure10;

            var listDiff = new SQLScriptList();
            listDiff.Add(new SQLScript(String.Format(@"/*

    Open DBDiff {0}
    http://opendbiff.codeplex.com/

    Script created by {1}\{2} on {3} at {4}.

    Created on:  {5}
    Source:      {6} on {7}
    Destination: {8} on {9}

*/

",
                System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
                Environment.UserDomainName, 
                Environment.UserName,
                DateTime.Now.ToShortDateString(),
                DateTime.Now.ToLongTimeString(),
                Environment.MachineName,
                SourceInfo != null ? SourceInfo.Database : "Uknown",
                SourceInfo != null ? SourceInfo.Server : "Uknown",
                Info != null ? Info.Database : "Uknown",
                Info != null ? Info.Server : "Uknown",
                0), 0, Enums.ScripActionType.None));
            if (!isAzure10)
            {
                listDiff.Add("USE [" + Name + "]\r\nGO\r\n\r\n", 0, Enums.ScripActionType.UseDatabase);
                listDiff.AddRange(Assemblies.ToSqlDiff(schemas));
                listDiff.AddRange(UserTypes.ToSqlDiff(schemas));
            }
			listDiff.AddRange(TablesTypes.ToSqlDiff(schemas));
			listDiff.AddRange(Tables.ToSqlDiff(schemas));
			listDiff.AddRange(Rules.ToSqlDiff(schemas));
			listDiff.AddRange(Schemas.ToSqlDiff(schemas));
			listDiff.AddRange(XmlSchemas.ToSqlDiff(schemas));
			listDiff.AddRange(Procedures.ToSqlDiff(schemas));
            if (!isAzure10)
            {
                listDiff.AddRange(CLRProcedures.ToSqlDiff(schemas));
                listDiff.AddRange(CLRFunctions.ToSqlDiff(schemas));
                listDiff.AddRange(FileGroups.ToSqlDiff(schemas));
            }
			listDiff.AddRange(DDLTriggers.ToSqlDiff(schemas));
			listDiff.AddRange(Synonyms.ToSqlDiff(schemas));
			listDiff.AddRange(Views.ToSqlDiff(schemas));
			listDiff.AddRange(Users.ToSqlDiff(schemas));
			listDiff.AddRange(Functions.ToSqlDiff(schemas));
			listDiff.AddRange(Roles.ToSqlDiff(schemas));
			listDiff.AddRange(PartitionFunctions.ToSqlDiff(schemas));
			listDiff.AddRange(PartitionSchemes.ToSqlDiff(schemas));
            if (!isAzure10)
            {
                listDiff.AddRange(FullText.ToSqlDiff(schemas));
            }
            return listDiff;
        }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:62,代码来源:Database.cs

示例12: ToSqlDiff

        public override SQLScriptList ToSqlDiff()
        {
            SQLScriptList list = new SQLScriptList();
            if (Status != Enums.ObjectStatusType.OriginalStatus)
                RootParent.ActionMessage[Parent.FullName].Add(this);

            if (HasState(Enums.ObjectStatusType.DropStatus))
                list.Add(Drop());
            if (HasState(Enums.ObjectStatusType.CreateStatus))
                list.Add(Create());
            if (HasState(Enums.ObjectStatusType.AlterStatus))
            {
                list.Add(Drop());
                list.Add(Create());
            }
            if (Status == Enums.ObjectStatusType.DisabledStatus)
            {
                list.Add(ToSqlEnabled(), Parent.DependenciesCount, Enums.ScripActionType.AlterIndex);
            }
            /*if (this.Status == StatusEnum.ObjectStatusType.ChangeFileGroup)
            {
                listDiff.Add(this.ToSQLDrop(this.FileGroup), ((Table)Parent).DependenciesCount, StatusEnum.ScripActionType.DropIndex);
                listDiff.Add(this.ToSQLAdd(), ((Table)Parent).DependenciesCount, StatusEnum.ScripActionType.AddIndex);
            }*/
            list.AddRange(ExtendedProperties.ToSqlDiff());
            return list;
        }
开发者ID:elayaraja007,项目名称:sql-dbdiff,代码行数:27,代码来源:Index.cs

示例13: ToSqlDiff

        public override SQLScriptList ToSqlDiff(List<ISchemaBase> schemas)
        {
            var isAzure10 = this.Info.Version == DatabaseInfo.VersionTypeEnum.SQLServerAzure10;

            var listDiff = new SQLScriptList();
            listDiff.Add(new SQLScript(String.Format(@"/*

            Open DBDiff {0}
            http://opendbiff.codeplex.com/

            Script created by {1}\{2} on {3} at {4}.

            Created on:  {5}
            Source:      {6} on {7}
            Destination: {8} on {9}

            */

            ",
                System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
                Environment.UserDomainName,
                Environment.UserName,
                DateTime.Now.ToShortDateString(),
                DateTime.Now.ToLongTimeString(),
                Environment.MachineName,
                SourceInfo != null ? SourceInfo.Database : "Uknown",
                SourceInfo != null ? SourceInfo.Server : "Uknown",
                Info != null ? Info.Database : "Uknown",
                Info != null ? Info.Server : "Uknown",
                0), 0, Enums.ScripActionType.None));
            listDiff.Add(new SQLScript(String.Format(@"
            SET NOEXEC OFF
            SET ANSI_WARNINGS ON
            SET XACT_ABORT ON
            SET IMPLICIT_TRANSACTIONS OFF
            SET ARITHABORT ON
            SET NOCOUNT ON
            SET QUOTED_IDENTIFIER ON
            SET NUMERIC_ROUNDABORT OFF
            SET CONCAT_NULL_YIELDS_NULL ON
            SET ANSI_NULLS ON
            SET ANSI_PADDING ON
            GO
            "), 0, Enums.ScripActionType.PreSets));
            if (!isAzure10)
            {
                listDiff.Add("USE [" + Name + "]\r\nGO\r\n\r\n", 0, Enums.ScripActionType.UseDatabase);
                listDiff.AddRange(Assemblies.ToSqlDiff(schemas));
                listDiff.AddRange(UserTypes.ToSqlDiff(schemas));
                listDiff.Add("BEGIN TRAN\r\nGO\r\n\r\n", 0, Enums.ScripActionType.BeginTransaction);
            }
            listDiff.AddRange(TablesTypes.ToSqlDiff(schemas));
            listDiff.AddRange(Tables.ToSqlDiff(schemas));
            listDiff.AddRange(Rules.ToSqlDiff(schemas));
            listDiff.AddRange(Schemas.ToSqlDiff(schemas));
            listDiff.AddRange(XmlSchemas.ToSqlDiff(schemas));
            listDiff.AddRange(Procedures.ToSqlDiff(schemas));
            if (!isAzure10)
            {
                listDiff.AddRange(CLRProcedures.ToSqlDiff(schemas));
                listDiff.AddRange(CLRFunctions.ToSqlDiff(schemas));
                listDiff.AddRange(FileGroups.ToSqlDiff(schemas));
            }
            listDiff.AddRange(DDLTriggers.ToSqlDiff(schemas));
            listDiff.AddRange(Synonyms.ToSqlDiff(schemas));
            listDiff.AddRange(Views.ToSqlDiff(schemas));
            listDiff.AddRange(Users.ToSqlDiff(schemas));
            listDiff.AddRange(Functions.ToSqlDiff(schemas));
            listDiff.AddRange(Roles.ToSqlDiff(schemas));
            listDiff.AddRange(PartitionFunctions.ToSqlDiff(schemas));
            listDiff.AddRange(PartitionSchemes.ToSqlDiff(schemas));
            if (!isAzure10)
            {
                listDiff.AddRange(FullText.ToSqlDiff(schemas));
                listDiff.Add("IF @@TRANCOUNT>0\r\n\tCOMMIT\r\nGO\r\n\r\n", 0, Enums.ScripActionType.EndTransaction);
            }
            listDiff.Add("SET NOEXEC OFF\r\n", 0, Enums.ScripActionType.PostSets);
            return listDiff;
        }
开发者ID:facingup,项目名称:opendbdiff,代码行数:79,代码来源:Database.cs

示例14: ToSqlDiff

        /*public List<ISchemaBase> FindAllByColumn(String ColumnName)
        {
            this.t
        }*/

        public override SQLScriptList ToSqlDiff()
        {
            var listDiff = new SQLScriptList();
            listDiff.Add("USE [" + Name + "]\r\nGO\r\n\r\n", 0, Enums.ScripActionType.UseDatabase);
            listDiff.AddRange(Assemblies.ToSqlDiff());
            listDiff.AddRange(Defaults.ToSqlDiff());
            listDiff.AddRange(UserTypes.ToSqlDiff());
            listDiff.AddRange(TablesTypes.ToSqlDiff());
            listDiff.AddRange(Tables.ToSqlDiff());
            listDiff.AddRange(Rules.ToSqlDiff());
            listDiff.AddRange(Schemas.ToSqlDiff());
            listDiff.AddRange(XmlSchemas.ToSqlDiff());
            listDiff.AddRange(Procedures.ToSqlDiff());
            listDiff.AddRange(CLRProcedures.ToSqlDiff());
            listDiff.AddRange(CLRFunctions.ToSqlDiff());
            listDiff.AddRange(FileGroups.ToSqlDiff());
            listDiff.AddRange(DDLTriggers.ToSqlDiff());
            listDiff.AddRange(Synonyms.ToSqlDiff());
            listDiff.AddRange(Views.ToSqlDiff());
            listDiff.AddRange(Users.ToSqlDiff());
            listDiff.AddRange(Functions.ToSqlDiff());
            listDiff.AddRange(Roles.ToSqlDiff());
            listDiff.AddRange(PartitionFunctions.ToSqlDiff());
            listDiff.AddRange(PartitionSchemes.ToSqlDiff());
            listDiff.AddRange(FullText.ToSqlDiff());
            return listDiff;
        }
开发者ID:elayaraja007,项目名称:sql-dbdiff,代码行数:32,代码来源:Database.cs

示例15: ToSQLChangeColumns

 private SQLScriptList ToSQLChangeColumns()
 {
     Hashtable fields = new Hashtable();
     SQLScriptList list = new SQLScriptList();
     if ((this.Status == Enums.ObjectStatusType.AlterStatus) || (this.Status == Enums.ObjectStatusType.RebuildStatus))
     {
         foreach (ObjectDependency dependency in this.Dependencys)
         {
             ISchemaBase itemDepens = ((Database)this.Parent).Find(dependency.Name);
             if (dependency.IsCodeType)
             {
                 list.AddRange(((ICode)itemDepens).Rebuild());
             }
             if (dependency.Type == Enums.ObjectType.Table)
             {
                 Column column = ((Table)itemDepens).Columns[dependency.ColumnName];
                 if ((column.Parent.Status != Enums.ObjectStatusType.DropStatus) && (column.Parent.Status != Enums.ObjectStatusType.CreateStatus) && ((column.Status != Enums.ObjectStatusType.CreateStatus)))
                 {
                     if (!fields.ContainsKey(column.FullName))
                     {
                         if (column.HasToRebuildOnlyConstraint)
                             column.Parent.Status = Enums.ObjectStatusType.RebuildDependenciesStatus;
                         list.AddRange(column.RebuildConstraint(true));
                         list.Add("ALTER TABLE " + column.Parent.FullName + " ALTER COLUMN " + column.ToSQLRedefine(null,0, "") + "\r\nGO\r\n", 0, Enums.ScripActionType.AlterColumn);
                         /*Si la columna va a ser eliminada o la tabla va a ser reconstruida, no restaura la columna*/
                         if ((column.Status != Enums.ObjectStatusType.DropStatus) && (column.Parent.Status != Enums.ObjectStatusType.RebuildStatus))
                             list.AddRange(column.Alter( Enums.ScripActionType.AlterColumnRestore));
                         fields.Add(column.FullName, column.FullName);
                     }
                 }
             }
         }
     }
     return list;
 }
开发者ID:modulexcite,项目名称:SQLoogle,代码行数:35,代码来源:XMLSchema.cs


注:本文中的SQLScriptList.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。