bschelst/ August 26, 2019/ SQL-Server/ 0 comments

If sys.fn_hadr_is_primary_replica ( 'CC_DLL' ) <> 1  
BEGIN 
    -- This is not the primary replica, exit without error. 
	 print 'Secondary node'
END 
-- This is the primary replica, continue to run the job... 
else
begin
  YOURACTIONS
end
Share this Post

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*

nine + 17 =