ecksfiftyone
ecksfiftyone

Reputation: 35

Suppress DBCC messages for sp_addarticle

Anyone know how to turn off this unwanted output? I have several stored procedures that are used to tear down and rebuild replication for hundreds of databases.

These stored procedures output lots of useful information on progress and results. This output is nicely formatted so the folks using these procedures can easily see how it's going and how it went.

Since upgrading from SQL Server 2017 to SQL Server 2022, the command sp_addarticle litters my nicely formatted output with the absolutely useless "DBCC execution completed. If DBCC printed error messages, contact your system administrator." This is new. This never happened with SQL Server 2017.

I've searched for a way to suppress these, but have not had any luck since I'm not actually running DBCC directly where I can use WITH NO_INFOMSGS.

Here is a sample of the query:

USE [my_database];
EXEC sp_addarticle 
    @publication = 'my_publication', 
    @article = N'my_table', 
    @source_owner = N'dbo', 
    @source_object = N'my_table', 
    @type = N'logbased', 
    @description = null, 
    @creation_script = null, 
    @pre_creation_cmd = N'drop', 
    @schema_option = 0x000000000803509F, 
    @identityrangemanagementoption = N'manual', 
    @destination_table = N'my_table', 
    @destination_owner = N'dbo', 
    @vertical_partition = N'false', 
    @ins_cmd = N'CALL [sp_MSins_dbomy_table]', 
    @del_cmd = N'CALL [sp_MSdel_dbomy_table]', 
    @upd_cmd = N'SCALL [sp_MSupd_dbomy_table]'

Upvotes: 1

Views: 40

Answers (0)

Related Questions