On creation error ignore also skip the grant select error

Related products: Software Factory

Sometimes when creating a view/function/stored procedure you get an error that you want to ignore during creation (for example when an external view or linked server is not accessible on development and is outside the scope of the branch). 

Error: 'Invalid object name'

You can select ignore error and continue execution. 
Doing this will give you a 2nd error on the same object: 

An unknown error occurred while executing '
grant select on "[object]" to public       
'. 

Error: 'Cannot find the object '[object]', because it does not exist or you do not have permission.'.

If you have multiple errors you will have to do a lot of skipping times 2. If possible please skip the grant select on the part you are ignoring. 

Hi Erwin,

Not sure how long we will continue granting public rights as with Indicium it is no longer a feature that is needed. In case your models do not need public rights to operate, you can disable the granting of rights to the public role by adding the model tag "NO_GRANT_TO_PUBLIC” for the Model.


NewOpen