简体   繁体   中英

How to comment SQL queries in SQL Server Management Studio (SSMS)

I have 3 SQL queries in SQL Server Management Studio (SSMS) as shown here - now, I want to comment them:

SELECT * 
FROM test.admin.store_category

SELECT * 
FROM test.admin.store_product

SELECT * 
FROM test.admin.store_user

Are there any ways to comment them?

You can use single-line comments with "--" and multi-line comments with "/* */" as shown below:

-- single-line comments

-- SELECT * FROM test.admin.store_category

SELECT * FROM test.admin.store_product

-- SELECT * FROM test.admin.store_user
/* multi-line comments */

/*
SELECT * FROM test.admin.store_category

SELECT * FROM test.admin.store_product
*/

SELECT * FROM test.admin.store_user

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM