Showing posts with label dependencies. Show all posts
Showing posts with label dependencies. Show all posts

Friday, March 9, 2012

Generate sysdepends list

:shocked: I can't seem to find a way of gettng a list of the view/stored procedure/UDF dependencies by object. Any ideas?What program are you using to do this?|||I am using ASP and vbscript to access the list and it is not retreiving all of the dependencies.:eek:|||Microsoft SQL doesn't guarantee 100% coverage for sysdepends. There will be some cases where you won't have a row that should be there.

-PatP|||Thanks Pat. I found shrinking the database brings newer dependencies into the list. Odd.:shocked:|||If a DDL script creates an object that references an object that does not yet exist (for instance, it is created later on...), then the first object will be created anyway but an entry will not be added to sysdepends. It should generate a warning to notify you of this.|||I create any dependencies a new store procedure, UDF or view needs first before creating the new piece to avoid the errors associated with referenced unknowns. Thanks for the tip.:)

Wednesday, March 7, 2012

Generate scripts doesn''t take into account dependencies

I'm having a problem with the generate scripts procedure in Sql Server Express. My database has stored procedures which use views. When I generate the database create script it puts the stored procedures before the views, so that the create script fails when I try to execute it, because the stored procedure can't be compiled until the view is defined. Is there a fix for this or a way around the problem?

Jon Webb

I found a workaround / fix: 1) Make the objects I was having trouble with schema bound; 2) Check "generate dependent objects" in the generate scripts wizard.

Generate scripts doesn''t take into account dependencies

I'm having a problem with the generate scripts procedure in Sql Server Express. My database has stored procedures which use views. When I generate the database create script it puts the stored procedures before the views, so that the create script fails when I try to execute it, because the stored procedure can't be compiled until the view is defined. Is there a fix for this or a way around the problem?

Jon Webb

I found a workaround / fix: 1) Make the objects I was having trouble with schema bound; 2) Check "generate dependent objects" in the generate scripts wizard.