Dev4Snow

Go back to ContentsGo back to previous page

Where-used List

Use this feature found in the Tree or in the SQL Tab context menu to find references to columns, table/view names or texts that are found in the DDL of objects located in the same database, favorite databases or all databases.

For example from the tree right-click on a table and select the option Where-used List. The following window will show up:

The Text field was automatically populated with the name of the table that you right-clicked, this is the text that Dev4Snow will try to find, and it may be a full name or a substring.

In this screen you have some options to select:

Database scope: Select if you want to search in the current database, your favorite databases or all databases. Depending on the number of databases in your Snowflake system the process will take more to complete, so try to reduce the scope when possible. By default Dev4Snow will search only in the current database, and in case you select My favorite databases or All databases, the first database where it will search will be the current database. You can cancel the process at any moment –by clicking the red square- and list all the entries that were found already.

Object scope: Check the boxes where the search will happen:

  • Table or view columns: Select this option to search in the table or view column names. This search is usually fast.
  • View definitions: Select this option to search in the View definitions (DDL of views). This search is usually fast.
  • Stored Procedure definitions: Select this option to search in the Stored Procedure definitions (DDL of procedures). This search is usually slow because Dev4Snow will first retrieve the list of Stored Procedures available for a database, then it will start to retrieve the DDL for each of them to find a match.
  • Function definitions: Select this option to search in the Function definitions (DDL of functions). This search is usually slow because Dev4Snow will first retrieve the list of Functions available for a database, then it will start to retrieve the DDL for each of them to find a match.

Depending on the context where you right-click to invoke the Where-used List feature, different object scopes will be automatically selected.

For example when right-clicking on:

  • Databases, schemas, tables or views => View definitions are selected, since none of those objects make sense to be part of a column name in a table or view, but they may still exist as part of a view definition. Stored Procedures and Functions are not selected because searching on them is slow, but if you need them just check the boxes.
  • Stored Procedures => Stored Procedure definitions and Function definitions are selected. Table or view columns and View definitions are not selected since they cannot invoke a Stored Procedure.
  • Functions => View definitions, Stored Procedure definitions and Function definitions are selected. Table or view columns are not selected since they cannot invoke a Function.

Example – Searching for a column name

You are reviewing the DDL for a table and you want to find all the references to a column named COUNTRY. In the editor you can double-click on the word COUNTRY to select it, then right-click to select the option Where-used List:

The Where-used List window will show up, and the Text has been automatically populated with the word COUNTRY. The database scope has been limited to search in the current DB, and the object scope has been limited to search in Table or view columns, and in View definitions. You can still change the default scope to include more databases or objects:

The result will be shown in the Results window –just like a regular query- and you will have the option to click on each of the lines for further details –by clicking on the Details button under the Action column.