Skip to main content
1-Visitor
December 14, 2016
Solved

SQL Comment

  • December 14, 2016
  • 1 reply
  • 2702 views

Is there a way to add comments in SQL?
Using -- makes the service invoke fail, with message The index .. is out of range.
Without comments the SQL query works as designed.

Kind regards,
SImon

Best answer by sdejager

I have done some more research and it seems to occur when there is the following in the comment:
[[SomeText]]

1 reply

5-Regular Member
December 14, 2016

Hi Simon, did you try something like this

/* Get All tables from DB.*/

Select * from tab

At least i use it for the Oracle not sure which DB you running.

sdejager1-VisitorAuthor
1-Visitor
December 14, 2016

Hello Sushant,

I am using a MS SQL server and using /* My comment */ gives the same error

5-Regular Member
December 15, 2016

Simon, I tested it with SQL Server too and it works without any problems. Would it be possible for you to post a sample SQL query you are using with the comment(s)?

BTW i could use the /* bla */ format for commenting while querying the SQL Server table.