Which system tables or views can I query to find dependencies for a given object? I need a list of objects that both use or is used by an object.

asked 06 Jul '10, 00:55

Brad%20Wery's gravatar image

Brad Wery
382182126
accept rate: 0%


For views/tables, you can use the sa_dependent_views system procedure.

It is much more problematic for other objects such as stored procedures. In SQL Anywhere, stored procedures are not "compiled" when created - they only need to be syntactically correct. Name resolution is done when the procedure is loaded, and with SQL Invoker semantics the objects that a procedure might reference will be different for each invoker. Also, since procedures/triggers/UDFs all permit EXECUTE IMMEDIATE, it can be very difficult to determine accurately which objects are referenced from a procedure/trigger/UDF.

permanent link

answered 06 Jul '10, 02:50

Glenn%20Paulley's gravatar image

Glenn Paulley
10.7k571104
accept rate: 43%

Thanks a lot. I'll take a look at sa_dependent_views.

(06 Jul '10, 16:38) Brad Wery
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×24

question asked: 06 Jul '10, 00:55

question was seen: 705 times

last updated: 06 Jul '10, 02:50