Hi, I'm using sp_addarticle to help manage table replication. This works very nicely - for most tables. For some, it inexplicably (to me at least!) fails with a Msg 14004 error.
Msg 14004, Level 16, State 1, Procedure sp_MSrepl_addarticle, Line 290
<table name> must be in the current database.
I can run the same code for tables alphabetically before or after those that fail. The same tables always have the same result, either the article is added or it doesn't. For example, it works for NAV table 'Purch. Cr. Memo Hdr.' and 'Posted Document Dimension' but not for 'Purch. Cr. Memo Line', 'Purch. Inv. Header' or 'Purch. Inv. Line'.
Note: This is NAV multi-company. The results are the same for all companies - i.e. adding an article for table Purch. Cr. Memo Line fails for each of the companies in the database. Adding an article for Purch. Cr. Memo Hdr. works for exah of the companies!
Can anyone shed any light on this?
The alternative is to use the GUI which is painfully slow due to the large number of items displayed in the Objects to Publish panel.