How to create trigger on database that 'triggers' when mirroring role changes from mirror to principal I want to perform some sql when my database mirroring state changes
Create an event notification for the Database Mirroring State Change. See Implementing Event Notifications for how to design a service that processes the notification and does whatever is appropriate. Keep in mind that event notifications are asynchronous.