• Hi,

    Depending on your criteria you could do something like:

    DECLARE@SQL Varchar(MAX)

    SELECT@SQL = ''

    --SELECTP.Name PubName, S.SrvName SubScriber, S.Dest_DB

    SELECT@SQL = @SQL +

    'sp_reinitsubscription @publication = '''+P.Name+

    ''', @subscriber = '''+S.SrvName+

    ''', @destination_db = '''+S.Dest_DB+

    ''', @invalidate_snapshot = 1' + CHAR(13)

    FROM[DBO].[sysPublications] P

    INNER JOIN [DBO].[sysArticles] A ON P.PubID = A.PubID

    INNER JOIN [DBO].[sysSubscriptions] S ON A.ArtID = S.ArtID

    WHERES.SrvName <> ''

    AND S.SrvName NOT IN ('List', 'of', 'subscribers', 'to', 'filter', 'out')

    GROUPBY P.Name, S.SrvName, S.Dest_DB

    PRINT @SQL

    --EXEC (@SQL)

    Better yet, create a table of subscriber servers you wish to reinitiate and join to it instead of using IN ('blah', 'blah')

    If more complex requirements are needed, alter the statement to use in a cursor.

    Hope this helps.



    For better, quicker answers on T-SQL questions, read Jeff Moden's suggestions.[/url]

    "Million-to-one chances crop up nine times out of ten." ― Terry Pratchett, Mort