Table Dependencies Missing

  • I did a backup of a database and renamed it as another database. In doing so, my table dependencies have been altered/deleted. Is there a way to rebuild them?

  • When you select from sys.sql_dependencies you get nothing? If so, how many table are returned from

    Select * from sys.tables?

  • The select from sys.sql_dependencies returns rows. But if I right-click on a table in the original DB and select View Dependencies, and then do the same in the copy, the list in the copied DB is sometimes differenct, or blank.

  • The Database Engine maintains both schema-bound and non-schema-bound dependencies. These dependencies are automatically refreshed during any operation that impacts dependency tracking, for example when upgrading a database from an earlier version of SQL Server or changing the collation of a database. Is the compatibility level set to 90? If so then you can set it to 80 and then back to 90 to see if that causes a refresh.

    You might also try just refreshing at the database level. It seems strange that the dependencies would have been affected by a rename. If it was the procedures you cared about you could try sp_refreshsqlmodule, but I don't think there is an equivalent for tables. However the GUI should be getting its information from the dynamic management catalogues, so maybe just right clicking the database and selecting refresh will do the trick since the information is stored in the catalogue.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply