Friday, March 7, 2025

How to check if replication is configured in a SQL Managed Instance

 Today, I had to verify if a SQL Managed Instance had replication turned on to investigate a login that showed up in a Defender vulnerability report.

Here's the query, hope it helps someone.


SELECT    name, 
          is_published, 
          is_subscribed, 
          is_merge_published, 
          is_distributor
FROM sys.databases
WHERE    is_published = 1 
         or is_subscribed = 1 
         or is_merge_published = 1 
         or is_distributor = 1

Checking Backup File Date Before Restoring

 Today, I got an interesting request.  I had to check a restore job for a data warehouse analyst.  He said the database wasn't restored ...