Skip to content

Recipe required for testing all database views in specified database #3

@adrianyorke

Description

@adrianyorke

Database views should be regularly tested to ensure that they are still functioning. Views are effectively a SELECT statement that queries data from database tables and other views. The underlying tables and join conditions that the view depends on can be modified in a way that breaks existing views if they have not been refactored in line with new db structure.

First, it is necessary to query the database catalog and loop through all database views that exist. For each view discovered, a simple "SELECT TOP 1 * FROM <database_view>;" will be sufficient to check that the view logic is still functioning. This technique should work even if there is no data loaded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions