Home > Archive > MS SQL Server > March 2006 > Bad record in sysforeignkeys









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Bad record in sysforeignkeys
rgrandidier

2006-03-05, 8:24 pm

Somehow there is a foreign key that references a table that doesn't exist.
How can I fix this? All I want to do is delete the record, but I get the
error "Object 'dbo.sysforeignkeys' cannot be modified." I already turned the
"Allow modifications to be made directly to the system catlogs" option on,
but now it seems I am running into some hidden check.

What can I do to resolve this?
--
Robert
Rick Sawtell

2006-03-05, 8:24 pm


"rgrandidier" < rgrandidier@discussi
ons.microsoft.com> wrote in message
news:5BA969B4-D5B5-4CB4-82D2- B1A48CC575A2@microso
ft.com...
> Somehow there is a foreign key that references a table that doesn't exist.
> How can I fix this? All I want to do is delete the record, but I get the
> error "Object 'dbo.sysforeignkeys' cannot be modified." I already turned
> the
> "Allow modifications to be made directly to the system catlogs" option on,
> but now it seems I am running into some hidden check.
>
> What can I do to resolve this?
> --
> Robert


What error message are you getting?

I had problems with a PK on a table with computed columns. It was causing
issues with my sysfilegroups table and the db maint plan failing on the
index rebuilds. It failed with an error message about sysfilegroups
indexing being bad. Of course you can't rebuild those indexes, so I tracked
down the sp_fixindex sproc.

I don't know if this will help you or not as it was a PK index issue, but it
might give you some direction.


In order to fix it I had to do the following...

SET ARITHABORT ON
SET ANSI_NULLS ON
exec sp_dboption '<dbname>', 'single user', TRUE
exec sp_fixindex '<indexname>', sysfilegroups, 1
exec sp_dboption '<dbname>', 'single user', FALSE


You may want to try it on your sysforeignkeys table..


Rick Sawtell
MCT, MCSD, MCDBA




Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com