表示用戶提供的文本??梢詫⒆⑨尣迦雴为?dú)行中、嵌套(只限 --)在 Transact-SQL 命令行的末端,或者 Transact-SQL 語句中。服務(wù)器不對(duì)注釋進(jìn)行評(píng)估。兩個(gè)連字符 (--) 是 SQL-92 標(biāo)準(zhǔn)的注釋指示符。
-- text_of_comment
text_of_comment
包含注釋文本的字符串。
將 -- 用于單行或嵌套的注釋。用 -- 插入的注釋由換行字符分界。
注釋沒有最大長度限制。
說明 在注釋中包含 GO 命令會(huì)生成一個(gè)錯(cuò)誤信息。
下面的示例使用 -- 注釋字符。
-- Choose the pubs database.
USE pubs
-- Choose all columns and all rows from the titles table.
SELECT *
FROM titles
ORDER BY title_id ASC -- We don't have to specify ASC because that
-- is the default.
相關(guān)文章