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


C# Index.Drop方法代码示例

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


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

示例1: DropIndex

 public IEnumerable<string> DropIndex(string tableName, string indexName)
 {
     Table table = GetTable(tableName);
     Index index = new Index(table, indexName);
     index.Drop();
     return ScriptChanges(table.Parent.Parent);
 }
开发者ID:richardprior,项目名称:MigSharp,代码行数:7,代码来源:SmoProvider.cs

示例2: DropConstraint

 private static IEnumerable<string> DropConstraint(string tableName, string constraintName, IndexKeyType keyType)
 {
     Table table = GetTable(tableName);
     Index uniqueConstraint = new Index(table, constraintName) { IndexKeyType = keyType };
     uniqueConstraint.Drop();
     return ScriptChanges(table.Parent.Parent);
 }
开发者ID:richardprior,项目名称:MigSharp,代码行数:7,代码来源:SmoProvider.cs

示例3: AddColumnToIndex

        public static void AddColumnToIndex(Table table, Column column, Index ind)
        {
            string oldName = ind.Name;
            var idx = new Index(table, oldName)
            {
                BoundingBoxYMax = ind.BoundingBoxYMax,
                BoundingBoxYMin = ind.BoundingBoxYMin,
                BoundingBoxXMax = ind.BoundingBoxXMax,
                BoundingBoxXMin = ind.BoundingBoxXMin,
                CompactLargeObjects = ind.CompactLargeObjects,
                DisallowRowLocks = ind.DisallowRowLocks,
                FileGroup = ind.FileGroup,
                FileStreamFileGroup = ind.FileStreamFileGroup,
                FileStreamPartitionScheme = ind.FileStreamPartitionScheme,
                FillFactor = ind.FillFactor,
                FilterDefinition = ind.FilterDefinition,
                IgnoreDuplicateKeys = ind.IgnoreDuplicateKeys,
                IndexKeyType = ind.IndexKeyType,
                IsClustered = ind.IsClustered,
                IsFullTextKey = ind.IsFullTextKey,
                IsUnique = ind.IsUnique,
                Level1Grid = ind.Level1Grid,
                Level2Grid = ind.Level2Grid,
                Level3Grid = ind.Level3Grid,
                Level4Grid = ind.Level4Grid,
                MaximumDegreeOfParallelism = ind.MaximumDegreeOfParallelism,
                NoAutomaticRecomputation = ind.NoAutomaticRecomputation,
                OnlineIndexOperation = ind.OnlineIndexOperation,
                PadIndex = ind.PadIndex,
                ParentXmlIndex = ind.ParentXmlIndex,
                PartitionScheme = ind.PartitionScheme,
                SecondaryXmlIndexType = ind.SecondaryXmlIndexType,
                SortInTempdb = ind.SortInTempdb,
                SpatialIndexType = ind.SpatialIndexType,
            };

            foreach (IndexedColumn iColumn in ind.IndexedColumns)
            {
                var newIdxColumn = new IndexedColumn(idx, iColumn.Name)
                {
                    Descending = iColumn.Descending,
                    IsIncluded = iColumn.IsIncluded,
                };
                idx.IndexedColumns.Add(newIdxColumn);
            }
            idx.IndexedColumns.Add(new IndexedColumn(idx, column.Name));

            bool oldDisallowPageLocks = ind.DisallowPageLocks;
            ind.Drop();
            idx.Create();
            idx.DisallowPageLocks = oldDisallowPageLocks;
            idx.Alter();
        }
开发者ID:kimanidev,项目名称:CFCDatabase,代码行数:53,代码来源:CfcWebService_Utilities.cs


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