Comments are used to explain sections of SQL statements, or to prevent execution of SQL statements.
Note: The examples in this chapter will not work in Firefox and Microsoft Edge!
Comments are not supported in Microsoft Access databases. Firefox and Microsoft Edge are using Microsoft Access database in our examples.
Single line comments start with --.
Any text between -- and the end of the line will be ignored (will not be executed).
The following example uses a single-line comment as an explanation:
See this example:
The following example uses a single-line comment to ignore the end of a line:
See this example:
The following example uses a single-line comment to ignore a statement:
See this example:
Multi-line comments start with /* and end with */.
Any text between /* and */ will be ignored.
The following example uses a multi-line comment as an explanation:
See this example:
The following example uses a multi-line comment to ignore many statements:
See this example:
To ignore just a part of a statement, also use the /* */ comment.
The following example uses a comment to ignore part of a line:
See this example:
The following example uses a comment to ignore part of a statement:
See this example: