How can I automatically make sure all database objects when the objects are changed?

  • hi all,

    I want detect which object (view, function, store producer) must by change when I alter object so that change column, schema, type, …

    How can I automatically make sure all database objects are OK, when the objects are changed?

  • There is no fool-proof answer that will allow you to check before you alter, if dependent objects use dynamic SQL, but outside of that problem, you can use sys.sql_expression_dependencies. Or you can right-click on the object you are about to alter, and click Dependencies. Longer term, consider http://www.sqlservercentral.com/blogs/sqlstudies/2014/08/06/schemabinding-what-why/. It prevents you from accidentally breaking dependent objects (apart from objects which contain dynamic SQL).

  • You could write yourself a data dictionary report in SSRS that would pull all dependencies on each object. Then refer to that report every time you go to make a change.

    But it's a large project and won't protect you from making changes but forgetting to update the dependencies.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

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

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