About 378,000 results
Open links in new tab
  1. SQL Comments - W3Schools

    Comments are used to explain sections of SQL statements, or to prevent execution of SQL statements. Note: Comments are not supported in Microsoft Access databases! Single line comments start with --. Any text between -- and the end of …

  2. SQL Comments (Comment in SQL Query) - QA With Experts

    Jul 16, 2024 · In this article, I have provided example to add comment in SQL Query for SQL Server, MySQL and in Postgres

  3. SQL Comments - GeeksforGeeks

    Jan 10, 2025 · In-line comments allow us to add comments within a query itself. They are typically used to provide additional information or explanations for specific parts of the query, without interrupting the flow of the SQL statement. In-line comments start with /* and end with */. Syntax: SELECT * FROM /* Customers; */ Explanation:

  4. Adding SQL Comments to Code - MSSQLTips.com - SQL Server …

    Jul 18, 2022 · There are 2 main methods of commenting T-SQL code. The first is to put two dashes (or hyphens) at the beginning of the line. Any text on that line after the dashes will be ignored by the compiler. In both SQL Server Management Studio (SSMS) and Azure Data Studio (ADS) all comments will be shown in green.

  5. SQL Comments: A How-To Guide - Database Star

    Jun 10, 2023 · Learn how to add SQL comments in this article. What is an SQL Comment? A comment in SQL is a piece of text in your code that is not executed when it is run on the database. This comment could be in a simple SQL query editor, an SQL file, or code that has been named such as a stored procedure.

  6. Comments in SQL (with examples) - CodeChef

    Learn how to use SQL comments to make your code easier to understand. This guide covers types of comments, syntax, best practices, and how to comment out code. Perfect for SQL beginners!

  7. An overview of SQL Comments - SQL Shack

    Oct 19, 2021 · The SQL comments in a statement help you to read and maintain the SQL scripts easily. For example, you can put a comment that showcases the purpose of the statement, such as adding a specific query hint or modifying script logic.

  8. How to Comment in SQL - LearnSQL.com

    You'd like to comment your code in SQL. Here's the example code: Use -- to comment code till the end of the line. Here is what it looks like: You can write single-line comments in SQL using --. After the --, you can write any comment you'd like as long as it's in one line.

  9. Selecting and Executing Commented T-SQL Code

    Mar 9, 2009 · When you have commented code using the C-style comment, it is easy to select any block of code inside and execute them: But what if you used SQL Server Management Studio’s (SSMS) single line comment shortcut to comment out parts of your code? Of course you can use the uncomment shortcut, but that’s still a bit of work.

  10. How to PROPERLY add comments in SQL [Multiple Ways]

    Nov 4, 2022 · Example 1: Write SQL query with the comment to specify what will be the result of the query and which line of the statement will be executed. OUTPUT: The Comments which starts in one line and ended in different line are considered multi-line comments.

Refresh