关于pd读取sqlserver2000对象扩展属性问题

关于pd读取sqlserver2000对象扩展属性问题

楼主shuiniu(飞扬的梦)(我是一头只吃西红柿的水牛)2006-08-08 13:35:26 在 软件工程/管理 / Power Designer 提问

--以下是跟踪到pd运行的一段sql  
  declare   @P1   int  
  set   @P1=1197  
  exec   sp_prepexec   @P1   output,   NULL,   N'select  
        u.name,  
        o.name,  
        c.colid,  
        c.name,  
        case   when   (s.usertype   <   100)   then   s.name   else   x.name   end,        
        c.prec,  
        c.length,  
        c.scale,  
        z.text,  
        case   (c.status   &   8)   when   8   then   ''NULL''   else   ''NOTNULL''   end,  
        case   (c.status   &   128)   when   128   then   ''identity''   else   ''''   end,  
        case   when   (s.usertype   <   100)   then   ''''   else   s.name   end,  
        case   (v.text)   when   ''('''''''')''   then   ''~''''''''~''   else   v.text   end,  
        case   (c.status   &   128)   when   128   then   ident_incr(u.name   +   ''.''   +   o.name)   else   null   end,  
        case   (c.status   &   128)   when   128   then   ident_seed(u.name   +   ''.''   +   o.name)   else   null   end,  
   
   
        convert(varchar,   p.value)   --问题出在这,是否应该改成convert(varchar(7500),   p.value)  
   
   
  from  
        dbo.sysusers   u  
              join   dbo.sysobjects   o   on   (o.uid   =   u.uid   and   o.type   in   (''U'',   ''S'',   ''V''))  
              join   dbo.syscolumns   c   on   (c.id   =   o.id)  
              left   outer   join   dbo.systypes   s   on   (c.usertype   =   s.usertype   and   s.xtype   =   c.xtype   and   c.usertype   >=   0)  
              left   outer   join   dbo.systypes   x   on   (s.usertype   >   100   and   s.xtype   =   x.xtype   and   x.usertype   not   in   (0,   18,   80)   and   x.usertype   <   100)  
              left   outer   join   dbo.syscomments   z   on   (z.id   =   o.id   and   z.number   =   c.colid)  
              left   outer   join   dbo.sysobjects   d   on   (d.id   =   c.cdefault   and   d.category   <>   0)  
              left   outer   join   dbo.syscomments   v   on   (v.id   =   d.id)  
              left   outer   join   dbo.sysproperties   p   on   (p.id   =   o.id   and   p.smallid   =   c.colid)  
  where   1   =   1        
      and   u.name   =   ''dbo''  
      and   o.name=''test''  
  order   by   1,   2,   3'  
  select   @P1  
   
  --------------------------------------  
  convert(varchar,   p.value)   当p.value的值长度较长(我的环境是大于30个字符)的时候,值会被截断,  
  可能引发的问题在通过Using   an   ODBC   data   source方式与pdm模型比较时候  
  会将原本不存在的差异也会错误的反映出来  
   
  环境:win2000   Server   sp4  
            pd   11.0.0.1363  
            Sqlserver   2000   Enterprise   Edition   sp3  
   
  convert(varchar,   p.value)   等价于   convert(varchar(30),   p.value)  
   
   
  Select   len(convert(varchar,replicate('a',40))),len(convert(varchar(40),replicate('a',40)))  
  /*  
                                                   
  -----------   -----------    
  30                     40  
   
  (影響   1   個資料列)  
   
   
  */  
   
  问题点数:20、回复次数:2Top

1 楼shuiniu(飞扬的梦)(我是一头只吃西红柿的水牛)回复于 2006-08-08 14:35:45 得分 0

找到解决方法了:Edit   Current   DBMS->Script->Objects->Column->SqlListQuery  
  Top

2 楼pleasetryagain()回复于 2006-08-08 14:57:36 得分 20

学习!

Tags(标签):关于p

文章评论
 专题推荐
     栏目更新
    站点导航

    天天网摘 Copyright(版权所有) © 天天网摘 2001~2009

    本站文章来源于网络,如果有侵犯你的权宜的地方,请指出我们会即时更正。

    Free Web Hosting