sql注释的多行注释

时间:2024-01-03 18:10:41 买帖  | 投诉/举报

篇首语:本文由小编为大家整理,主要介绍了sql注释的多行注释相关的知识,希望对你有一定的参考价值。

一、多行注释

与C语言相同的程序注释符号,即“/**/”。“/*”用于注释文字的开头,“*/”用于注释文字的结尾,可在程序中标识多行文字为注释。

二、格式:/*注释内容*/。

例子:

DECLARE @myvariable DATETIME

1、The following statements retrieve the current date and time and extract the day of the week from the results.

2、SELECT @myvariable=GETDATE()。

SELECT DATENAME(dw,@myvariable)。



扩展资料:

一、单行注释

1、ANSI 标准的注释符“--” 用于单行注释,格式:--注释内容。

2、例子:

use pangu-- 使用名为pangu的数据库。

declare@startdate datetime。

set@startdate="1/1/2000’。

select"Start Date:’+convert(varchar(12)@startdate)。

convert()函数用于转换数据类型。

注意这里的注释'--'符号后需要一个空格,注释才生效。

参考资料来源:

百度百科-sql注释

参考技术A

与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)

以上是关于sql注释的多行注释的主要内容,如果未能解决你的问题,请参考以下文章