sp_help代码里面有这么一串代码,这个函数TypePropertyEx好像没有啊我翻了2005和2008的都没有这个函数,有的只是TypeProperty   -- DATA TYPE HELP (prec/scale only valid for numerics)  
select  
   'Type_name' = name,  
   'Storage_type' = type_name(system_type_id),  
   'Length'  = max_length,  
   'Prec'   = Convert(int,TypePropertyEx(user_type_id, 'precision')),  
   'Scale'   = Convert(int,TypePropertyEx(user_type_id, 'scale')),  
   'Nullable'   = case when is_nullable=1 then @yes else @no end,  
   'Default_name' = isnull(object_name(default_object_id), @none),  
   'Rule_name'  = isnull(object_name(rule_object_id), @none),  
   'Collation'  = collation_name  
  from sys.types  
  where user_type_id = @objid  
  

解决方案 »

  1.   

    TYPEPROPERTY
    返回有关数据类型的信息。语法
    TYPEPROPERTY ( type , property )参数
    type是数据类型的名称。property是要返回的数据类型的信息类型。property可以是下列值之一:属性 描述 返回的值 
    Precision 数据类型的精度。 数字位数或字符个数。 
    NULL = 数据类型未找到。
     
    Scale 数据类型的小数位数。 数据类型的小数位的个数。 
    NULL = 数据类型不是 numeric 或未找到。
     
    AllowsNull 数据类型允许空值。 1 = True
    0 = False
    NULL = 数据类型未找到。 
    UsesAnsiTrim 创建数据类型时 ANSI 填充设置为 ON。 1 = True
    0 = False
    NULL = 数据类型未找到,或不是二进制数据类型或字符串数据类型。 
    返回类型
    int示例
    下例返回 integer 数据类型的精度或位数。SELECT TYPEPROPERTY( 'tinyint', 'PRECISION')
      

  2.   

    TypePropertyEx\TypeProperty
    根据微软的习惯,Ex就是个加强版
      

  3.   


    关键是这个加强版没有啊。。他怎么写到代码里面了。谁有MSDN账号去问问。
      

  4.   

    有这个函数啊,DATABASEPROPRERTYEX()