We have a little powershell script to take care of this.
To make the script more robust so we can re-run it and re-use it,
I'm trying to check to see if the database I'm trying to mirror already has a partner...
Something like:
Then I can go on through the rest of the code and setup the servers and databases for mirroring.
My question is, how do I perform the:
IF (Principal Database has Partner) check?
Thanks
To make the script more robust so we can re-run it and re-use it,
I'm trying to check to see if the database I'm trying to mirror already has a partner...
Something like:
Code:
IF (Principal Database has Partner)
Alter Database [TheDataBase] SET PARTNER OFF
Then I can go on through the rest of the code and setup the servers and databases for mirroring.
My question is, how do I perform the:
IF (Principal Database has Partner) check?
Thanks