• Hi,

    unfortunately neither sys.sysdatabases nor sys.databases (or even DATABASEPROPERTYX) can provide any usefull information regarding if the database is subscribed or not. (See Book Online).

    If you want to check this part you should use something like this:

    USE DB

    DECLARE @replication_role NVARCHAR(15) = ''''

    IF OBJECT_ID(''dbo.MSreplication_objects'') IS NOT NULL

    SET @replication_role = ''Subscriber''

    You can wrap up the code into sp_MSforeachdb.