Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Creating a Job for publication in Sql Server with select statement for passing a parameter

$
0
0

I am creating a job for adding article to a publication.  the second step (e.g. for adding article) gives me error. I pass the name of the table as follow:

     EXEC sp_addarticle
           @publication = 'TTB', --THE NAME OF MY PUBLICATION
           'select top (1)' @article = 'Name from TableAdded Order by create_date Desc',
           'select top (1)' @source_object = 'Name from TableAdded Order by create_date Desc',
            @force_invalidate_snapshot = 1;

TableAdded is a table I have in my publisher which contains the name of the newly added table.

I believe it fails because the way I pass the name of the article to the store procedure is not correct. Can anyone please help me on that?

Kind regards

Amin


Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>