9

I'm trying to set up transactional replication on a Dynamics NAV database on SQL Server 2008 R2 SP1.

Using the same servers I have been able to set up replication successfully on a different DB.

I'm able to create the publication, subscription and the snapshot, but when I look in the event log I see the following error:

Replication-Replication Distribution Subsystem: agent [agent name] failed. Missing end comment mark '/'.*

Replication isn't working, and the replication monitor effectively hangs when interrogating this DB.

A Google search returns this page: MS Connect But I'm struggling to find where the system-generated stored procedure they refer to resides. I've tried hunting it down in the Profiler app with various filters, but not having much joy locating it.

Any help would be greatly appreciated!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Loic
  • 111
  • 8
  • I don't know the solution, but I have to say: Wow, what a stupid parser fail! Way to go Microsoft! – dan1111 Dec 13 '12 at 14:59
  • Would you be able to try running the create script for all Programmability objects? It's a bit of a brutal method, but it would allow you to see if any of them fails. – Diego Dec 13 '12 at 15:01
  • 14
    From the connect item it looks as though the failure occurs when **you** have a stored procedure with `GO` inside a comment. I guess you can find it with `SELECT * FROM sys.sql_modules where definition LIKE '%/*%GO%*/%'` then change the comment. – Martin Smith Dec 13 '12 at 15:11
  • Thanks, Martin. This seems to have done the trick! – Loic Dec 20 '12 at 08:56
  • @Martin: Just stumbled across this, looks like you may want to promote your comment into an answer. – Cᴏʀʏ Jun 25 '15 at 12:59

1 Answers1

3

I notice that Martin's comment (also the most upvoted) solves the problem, as acknowledged by Loic. All credits due to Martin.

From the connect item it looks as though the failure occurs when you have a stored procedure with GO inside a comment. I guess you can find it with SELECT * FROM sys.sql_modules where definition LIKE '%/%GO%/%' then change the comment. – Martin Smith Dec 13 '12 at 15:11

Thanks, Martin. This seems to have done the trick! – Loic Dec 20 '12 at 8:56

Community
  • 1
  • 1
Whirl Mind
  • 884
  • 1
  • 9
  • 18
  • This behavior is UNBELIEVABLE. Still persists in SQL Server 2019. Testing now to see if eliminating GO from comments solves the problem there. – Allen Oct 18 '21 at 20:49