guojing219 发表于 2009-08-27 11:09

sp_helpconstraint无结果,不能新建也不能删除 已解决

之前建立索引的步骤:
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执行后显示无结果,现在即不能新建也不能删除,请教各位大侠教教我! 65482473


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 编辑 ]

guojing219 发表于 2009-08-27 11:50

各位,问题已经解决~

各位,问题已经解决~
页: [1]
查看完整版本: sp_helpconstraint无结果,不能新建也不能删除 已解决