Database Handicapping Software- JCapper

JCapper Message Board

          JCapper 101
                      -- SQL Comment

Home Register
Log In
By SQL Comment
12:46:19 PM
Is there a way to comment a line (or block of lines) when working in sql? I tried -- for a single line and also tried /* */ for a block of lines...neither worked, I get a Syntax error.


12:45:31 PM
The T-SQL programming command set used by the Jet DB Drivers for Access (and JCapper) do not support comments.

There is, however, a work around I have used in the past... the line below is an example:

AND NOT TRAINER = 'COMMENT - udm takes advantage of ugly form'


1. In the above line I am saying that TRAINER is not equal to the text characters "COMMENT - udm takes advantage of ugly form" (without the quotes.)

2. It works because TRAINER is a valid table field but no trainer in the database will match the text characters I am using as my comment.

3. Probably best to avoid using characters in your comment text that are part of the sql command set such as: !, @, #, $, %, &, *, (, ), [, ], etc... as well as words that have meaning as sql commands such as AND, OR, FOR, SELECT, DELETE, etc.




Copyright 2018 JCapper Software              back to the JCapper Message Board