表已删除, 可syscolumns里还能找到此表的字段..请问怎样删除sysobjects、sysindexes、syscolumns里那些错误的记录?

解决方案 »

  1.   

    为了安全,SQL系统表默认是不允许修改值的,我们可以通过以下语句打开或关闭。
    sp_configure 'allow updates', 0    --  此时不允许修改值
    sp_configure 'allow updates', 1    --允许对系统表进行修改
    RECONFIGURE WITH OVERRIDE    --   更新使用 sp_configure 系统存储过程更改的配置选项的当前配置解决方法:
    sp_configure 'allow updates', 1
    RECONFIGURE WITH OVERRIDE
    然后再修改你要修改的表(如:sysdatabases里的)。
    完成之后记得修改系统表的修改权限:
    sp_configure 'allow updates', 0
    RECONFIGURE WITH OVERRIDE
      

  2.   

    基本上不会出现这种问题,应该是dbo/schema不同的另一个表,而不是已经删除的表
      

  3.   


    sp_configure 'allow updates', 1 
    RECONFIGURE WITH OVERRIDE  
    delete sysindexes where id = object_id('userconfig')
    sp_configure 'allow updates', 0
    RECONFIGURE WITH OVERRIDE 怎么执行后有错误