免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5098 | 回复: 2
打印 上一主题 下一主题

求sp_pb60table存储过程 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-02-09 15:03 |只看该作者 |倒序浏览
PB连接sybase时报少了一个sp_pb60table的存储过程,是怎么一会事,请有这个过程的xdjm上传一下那个过程,:right: :right: ,谢谢。

论坛徽章:
0
2 [报告]
发表于 2004-02-09 22:18 |只看该作者
不是吧?没有见到过这个问题。

论坛徽章:
0
3 [报告]
发表于 2010-06-02 15:49 |只看该作者
create procedure sp_pb60table
@table_name  varchar(32) = null,
@table_owner varchar(32) = null,
@table_qualifier varchar(32) = null,
@table_type  varchar(100) = null
as
declare @type1 varchar(3)
if @table_type is null
  begin
   select @type1 = \'SUV\'
  end
else
  begin
   select @type1 = null
   if (charindex(\"\'SYSTEM TABLE\'\", @table_type) != 0)
    select @type1 = @type1 + \'S\'
   if (charindex (\"\'TABLE\'\", @table_type) != 0)
     select @type1 = @type1 + \'U\'
   if (charindex (\"\'VIEW\'\", @table_type) != 0)
     select @type1 = @type1 + \'V\'
  end
if @table_name is null
  begin
   select @table_name = \'%\'
  end
else
  begin  
   if (@table_owner is null) and (charindex(\'%\', @table_name) = 0)
    begin
     if exists (select * from sysobjects where uid = user_id() and
           name = @table_name and (type = \'U\' or type = \'V\' or type = \'S\'))
      begin
       select @table_owner = user_name()
      end
    end
  end
  if @table_owner is null 
    select @table_owner = \'%\'  
  select o.name, o.id, o.type, o.uid, user_name(o.uid)
  from sysusers u, sysobjects o
  where o.name like @table_name
  and user_name(o.uid) like @table_owner
  and charindex(substring(o.type,1,1),@type1) != 0
  and u.uid = user_id()
  and (suser_id() = 1
  or o.uid = user_id()
  or ((select max(((sign(uid) * abs(uid-16383)) * 2) + (~(protecttype/2)))
    from sysprotects p
    where p.id = o.id
    and (p.uid = 0
    or p.uid = user_id()
    or p.uid = u.gid)
    and (action in (193,224)))&1) = 1)
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP