BUG: Recreating a Table Causes sysdepends to Become InvalidID: Q115333
|
If a stored procedure or view depends on a table that has been dropped, sysdepends will continue referencing the old ID of the table as a dependent, even if this ID does not exist any more. As a result, sp_depends will not show the correct object dependency.
Drop and recreate the stored procedure or view. The entries for sysdepends will be properly recreated.
Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 4.21a, 6.0, and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
The following is an example of the problem. First, create the table and
procedure referencing that table.
create table testx (c int)
go
create procedure procx as select * from testx
go
select name, id from sysobjects where (name = "testx")
or (name = "procx")
go
name id
----------------------------- ----------
testx 464004684
procx 480004741
drop table testx
go
create table testx (c int)
go
select id from sysobjects where name = "testx"
id
-----------
512004855
select id, depid from sysdepends where id = 480004741
id depid
---------- ----------
480004741 464004684
Additional query words: Windows NT
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: March 18, 1999