I have a job that runs sp_refreshview on all views in a database. Once, we dropped a table from the database but forgot to remove the view that was pointing to it. Because of this, the sp_refreshview stored procedure raised an error and everything stopped.
Is there a way to catch this error such that the rest of the query may continue (to refresh the rest of the views)? Thanks.