question

geosta avatar image
geosta asked

How can I create a stored proc across all DBS That Exists in an Availabity Group

I have written some dynamic SQL in Master that executes a stored procedure if it exists in local databases.

I now need to create a query that will execute the stored proc across all databases if it exists, and if it does not exist will create it. This must only occur if the corresponding database exists in the availability group.

Thanks in advance for any help.

Kind regards,

George

stored-proceduresdynamic-sqlavailability-groups
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.