免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2913 | 回复: 1

sp_helpconstraint无结果,不能新建也不能删除 已解决 [复制链接]

论坛徽章:
0
发表于 2009-08-27 11:09 |显示全部楼层
之前建立索引的步骤:
sp_primarykey GRJBXX,aac001                     /*个人基本信息*/
go
create unique clustered index grjbxx on GRJBXX (aac001)
go

上面的转变成---------------------------》如下:
sp_primarykey GRJBXX,aac001
go
create unique clustered index grjbxx_idx00 on GRJBXX (aab001, aac031)
go


我现用drop index GRJBXX.grjbxx,删除了索引,
现在不能新建关键字了,sp_helpkey GRJBXX,显示有关键字,sp_helpconstraint执行后显示无结果,现在即不能新建也不能删除,请教各位大侠教教我!


1> sp_primarykey GRJBXX,aac001
2> go
Primary key already exists on table -- drop key first.
(return status = 1)
1>
1> create unique clustered index grjbxx_idx00 on GRJBXX (aab001, aac031)
2> go
Msg 1505, Level 16, State 1:
Line 1:
Create unique index aborted on duplicate key.  Primary key is '120801'
1>

1> sp_helpkey GRJBXX
2> go
For information on declarative integrity features : PRIMARY KEY, UNIQUE, FOREIGN
KEY, CHECK CONSTRAINT, REFERENTIAL CONSTRAINT, NULL/NOT NULL, and DEFAULT, use
sp_helpconstraint, a new system stored procedure.
keytype    object                         related_object
        object_keys
        related_keys
---------- ------------------------------ ------------------------------
       ----------------------------------------------------------------------
       ----------------------------------------------------------------------
primary    GRJBXX                          -- none --
        aac001, *, *, *, *, *, *, *
        *, *, *, *, *, *, *, *
(1 row affected, return status = 0)
1>

1> sp_helpconstraint GRJBXX
2> go
name
        defn
------------------------------
       -----------------------------------------------------------------------
(0 rows affected, return status = 0)
1>

[ 本帖最后由 guojing219 于 2009-8-31 10:14 编辑 ]

论坛徽章:
0
发表于 2009-08-27 11:50 |显示全部楼层

各位,问题已经解决~

各位,问题已经解决~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP