Script missing end comment mark in replication

James Tall 0 Reputation points
2023-05-26T20:32:07.48+00:00

I'm setting up a transactional replication between an on-prem server and an Azure VM with SQL. The snapshot and publication are without error.

During the initial sync it is failing and the action message is "Missing end comment mark"*/". In the details I can see where this is true in the script snippet it shows, but I cannot find where this script is, or the name of it to fix it. It will not go past this. I do see a view that's referenced in the script and I excluded it from the publication, but that did not help.

I'm looking to see if there's a way to see what script this file is in so i can fix it and get past this error. Any help appreciated!

User's image

SQL Server Other
{count} votes

1 answer

Sort by: Most helpful
  1. Chandu_0124 11 Reputation points
    2023-06-01T03:36:07.3433333+00:00

    @James Tall

    It's hard to tell what's the issue without the full script.

    I guess you might missing '*/' at the end of the script.

    Here’s an example of some T-SQL code that returns this error:

    /*
    Alter FT_View.sql ********** 
    CREATE OR ALTER VIEW FT_VIEW 
    as 
    select 
    

    Result:

    Msg 113, Level 15, State 1, Line 8 Missing end comment mark '*/'.

    How to Fix the Error:

    The way to fix this error is to either add a closing comment mark, or remove the opening one.

    So either:

    /*
    CREATE OR ALTER VIEW FT_VIEW 
    as 
    select 
    */
    

    Which makes the whole thing a comment, or:

    CREATE OR ALTER VIEW FT_VIEW 
    as 
    select 
    

    Which removes the comment, and runs the statement.

    Obviously, this is just a sample statement for demonstration purposes, your statement will probably be different.

    You need the check SQL script thoroughly to find the missing part or you can remove '/*' at the beginning of your script.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.