Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Adding Article to Replication

Author  Topic 

albertkohl
Aged Yak Warrior

740 Posts

Posted - 2009-07-19 : 00:23:25
I'm trying to add a new table to replication via T-SQL.

however whenever i add this article, it causes the subscriber to stop because it says it's invalid.

here's my sql code, any help would be GREAT! (this is off MSDN BOL's)


use MyDB
EXEC sp_addmergearticle
@publication = 'MyDBPub',
@article = 'MyNewTable',
@source_object = 'MyNewTable',
@type = N'table',
@source_owner = 'dbo',
@schema_option = 0x0004CF1,
@force_invalidate_snapshot =1


any pointers where i can add the article, get it to subscribers, w/o having to reinitialize would be AWSOME

albertkohl
Aged Yak Warrior

740 Posts

Posted - 2009-07-19 : 01:43:56
also just tried:

use MyDB
EXEC sp_addmergearticle
@publication = 'MyDBPub',
@article = 'MyNewTable',
@source_object = 'MyNewTable',
@force_reinit_subscription =1


same deal.

it's a really small table, so if i have to re-create the snapshot, and then reinitialize
the subscription, that would be fine, but it's preferable to be able to just add the
article and push it to the subscriber with out having to snapshot

Any help would be great!
Go to Top of Page
   

- Advertisement -