T-SQL » Comments » Single Line Comment

Syntax:
-- Text to be commented

Two hyphens (--) are put just before the text to be commented. This type of comment extends only up to the end of the commented line.

Examples

Code:
CREATE TABLE Students
    -- A table named Students
    (
       Id INT PRIMARY KEY, -- with Primary Key as Id
       Name VARCHAR (50) NOT NULL,
       Address VARCHAR (40) NOT NULL,
       Phone INT
    ) --- will be created-----

Explanation:

Creates the Students table. The text after -- in each line are comments and will not be evaluated by the SQL Server.

Language(s): MS SQL Server