Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Continue script after error (sp_refreshsqlmodule)

$
0
0

Hi,

I am trying to update object dependency metadata in the db (sql server 2008R2), using sp_refreshsqlmodule stored procedure. I created cursor that goes through all stored procedures and runs sp_refreshsqlmodule for each of them (as dynamic sql). For most of stored procedures, it runs fine, but for some of them it fails with the same ridicilous error: "Invalid column name 'daytype_seq_no'." ("ridicilous" because there is no such column in any of the objects related to our stored procedures, so it is some sql bug). 

I would like to skip this error and continue runnning the script to go to the next stored procedure in the cursor.

Is there any way to do this (I am using try..catch block)?

Thanks,

Pedja


Pedja


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>