1、单行注释ANSI 标准的注释符“--” 用于单行注释,格式:--注释内容。例子:use pangu-- 使用名为pangu的数据库declare@startdate datetimeset@startdate=‘1/1/2000’select‘Start Date:’+convert(varchar(12)@startdate)-- convert()函数用于转换数据类型-- 注意这里的注释--符号后需要一个空格,注释才生效2、多行注释与C语言相同的程序注释符号,即“/**/”。“/*”用于注释文字的开头,“*/”用于注释文字的结尾,可在程序中标识多行文字为注释。格式:/*注释内容*/例子:DECLARE @myvariable DATETIME/*The following statements retrieve the current date and time and extract the day of the week from the results.*/SELECT @myvariable=GETDATE()SELECT DATENAME(dw,@myvariable)