Generate invalid dependency object list in SQL Server 2008

  • Not sure if this is the right place, so if its not, please direct me to it.

    I want to generate a list of all objects in a database which are no longer valid (reference invalid tables, columns, etc...). Is there a way to do this? Any insight would be appreciated!

    Thanks,

    Michael

  • i've got this script i posted here on SSC multiple times that seems to do a nice job for me;

    for Invalid Objects, it's not like oracle, where there is a column to query to test whether something was compiled successfully.

    note this doesn't give you a list of what is broken NOW, but rather tries to recompile everything, and reports what fails to compile.

    sp_InvalidObjects.txt

    also note it's expecting a coding convention of a single space between CREATE PROC/VIEW/FUNCTION

    --expected

    CREATE PROC

    --fails

    CREATE PROC

    so if you have objects that have more whitespace between them, it may report them as invalid, when they are actually ok.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • That is perfect. Thank you!

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

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