Hi,
i noticed a strange things.
I implemented code :
DECLARE @result INT; SET @result = (select sys.fn_hadr_is_primary_replica ( 'your datbase name' ) ) IF @result = 0 RAISERROR('Server not primary for database',16,0);
it works fine if i reboot server or if i implement it without do failover. If i do manual failover jobs run on both server(at the moment i don't have selected Set the failure action for this first step to "Quit the job reporting success".)
I imported sql job from management studio CREATE to SQL file file and after imported with a query(i dropped file on management studio and i executed it)
What i miss?