• Dynamics CRM 2011 通过数据库修改实体字段的长度需要注意的地方


    一、首先打开数据库,我这里以SQL Server 2012数据库为例。

        1.选择工具—>选项 ,如图1

         

                            图 1

        2. 选择表设计器和数据库设计器—>阻止保存要求重新创建表的更改(S)把前面checkbox勾选去掉,然后点击确定,如图2

        

                                                             图 2

    二、打开数据库名对应的表,找到要修改的属性,这里相信只要大家学过基本的SQL知识都会改的。具体如图3

    把200改为2000 保存下。改的字段为abc_value。

    三、通过SQL根据PhysicalName 和 AttributeId 在Attribute表确定其是abc_value这个值。然后在Update其MaxLength的长度为2000,具体代码如下:

    SELECT TOP 100 [AttributeId]
          ,[AttributeTypeId]
          ,[Name]
          ,[PhysicalName]
          ,[Length]
          ,[IsNullable]
          ,[XmlAbbreviation]
          ,[EntityId]
          ,[DefaultValue]
          ,[ColumnNumber]
          ,[ValidForUpdateAPI]
          ,[LogicalName]
          ,[ValidForReadAPI]
          ,[ValidForCreateAPI]
          ,[VisibleToPlatform]
          ,[IsPKAttribute]
          ,[IsCustomField]
          ,[IsLogical]
          ,[DisplayMask]
          ,[AttributeOf]
          ,[ReferencedEntityObjectTypeCode]
          ,[AggregateOf]
          ,[IsSortAttribute]
          ,[PrecisionValue]
          ,[PrecisionSource]
          ,[IsIdentity]
          ,[IsReplicated]
          ,[VersionNumber]
          ,[YomiOf]
          ,[AttributeRowId]
          ,[AppDefaultValue]
          ,[AttributeLogicalTypeId]
          ,[Locked]
          ,[AttributeImeModeId]
          ,[AttributeRequiredLevelId]
          ,[MaxLength]
          ,[MinValue]
          ,[MaxValue]
          ,[Accuracy]
          ,[AccuracySource]
          ,[LookupStyle]
          ,[LookupBrowse]
          ,[ImeMode]
          ,[HasMultipleLabels]
          ,[IsRowGuidAttribute]
          ,[IsBaseCurrency]
          ,[CalculationOf]
          ,[IsAuditEnabled]
          ,[UpgradeDefaultValue]
          ,[OptionSetId]
          ,[SolutionId]
          ,[SupportingSolutionId]
          ,[ComponentState]
          ,[OverwriteTime]
          ,[LinkedAttributeId]
          ,[InheritsFrom]
          ,[IsStoredOnPrimaryTable]
          ,[IsInheritanceTypeAttribute]
          ,[TableColumnName]
          ,[IsUnmanagedAttribute]
          ,[IsOneWayBooleanAttribute]
          ,[IsCustomizable]
          ,[IsRenameable]
          ,[CanModifySearchSettings]
          ,[CanModifyRequirementLevelSettings]
          ,[CanBeSecuredForCreate]
          ,[CanBeSecuredForRead]
          ,[CanBeSecuredForUpdate]
          ,[IsSecured]
          ,[DeprecatedVersion]
          ,[IsManaged]
          ,[ManagedPropertyLogicalName]
          ,[ManagedPropertyParentComponentType]
          ,[ManagedPropertyParentAttributeName]
          ,[CanModifyAdditionalSettings]
          ,[ValuesFromRelationshipAttribute]
          ,[CanModifyAuditSettings]
      FROM [组织名称_MSCRM].[MetadataSchema].[Attribute]
      WHERE PhysicalName = 'abc_value' AND AttributeId='F9EE8BA9-69F4-487A-A335-D565FBE9D0FA'
    SQL1

    SQL1你可以先去掉后面的AttributeId属性,试着查看。

    1 Update Attribute
    2   SET  MaxLength = 2000
    3   WHERE PhysicalName = 'abc_value' AND AttributeId='F9EE8BA9-69F4-487A-A335-D565FBE9D0FA' 
    SQL2

     SQL2就是执行修改的方法。

    说明:在数据库里面修改实体字段的长度的时候,二和三步骤都不能少。

  • 相关阅读:
    Spring MVC 程序首页的设置
    绿色版Tomcat 启动 + 停止 + 随系统自动启动
    Lazy Load, 延迟加载图片的 jQuery 插件
    ibatis参数传递小技巧
    SpringMVC接收页面表单参数-java-电脑编程网
    用 JS 点击左右按钮 使图片切换
    JS数组方法汇总 array数组元素的添加和删除
    关于jQuery UI 使用心得及技巧
    MySQL查询in操作 查询结果按in集合顺序显示_Mysql_脚本之家
    JSTL c标签,fn标签,fmt标签
  • 原文地址:https://www.cnblogs.com/allenhua/p/3472254.html
Copyright © 2020-2023  润新知