Hi,
I have this database that is participating in an aoag and I want to have some intelligence in the backup jobs to check if the current db is the primary replica and if it is, to proceed with the backup. But I specifically want to include this section of t-sql in the overall script;
SELECT (DATABASEPROPERTYEX('database_name','Updateability'))
this will return READ_WRITE or READ_ONLY
is there any way to use this to get the job set up?