Great! This script will be **very** useful for me!! Thank you!
Just a little doubt: until now 😉 when I needed to refresh all views, I was used to create the script with all DROP and CREATE for all views, to be sure that the views are refreshed (actually: re-created) in the correct order. I'm afraid that if I refresh the views in a wrong order, I can have the same unexpected results. In other words: if I have the following dependencies chain:
view VC depend on view VB
view VB depend on view VA
and I do NOT change VC and VB, but change the structure of the VA (for example adding a new column in the middle of the SELECT column list), I'm afraid that if I refresh VC **before** refreshing VB, I can have unexpected results on VC. Instead, if I refresh (or re-create) VB before VC, everything will be ok.
I'm wrong?
Your script refreshes all views in alphabetical order... then my doubt...
Another think: I think that StpredProcedures and User defined Function do not need to be refreshed, even if underlying objects change. Is this correct?
Thank you again!
Flavio.