From Excel to SQL - Comments (-- and /**/)

Опубликовано: 16 Май 2026
на канале: Bill Wallis
33
1

Adding good comments to your SQL code is a great way to make your code more accessible since it gives anyone who reads your code additional context that they might not have. They're also helpful while you're writing your code to test what the query outputs without some parts of the code!

The dbfiddle website can be accessed for free and without an account at:

https://dbfiddle.uk/

Make sure to use the SQL Server dialect and the AdventureWorks sample database to be able to follow along with these examples!

---------------------------------------------------

This is part of the From Excel to SQL playlist, available at:

   • From Excel to SQL  

Check out the previous video at:

   • From Excel to SQL - Sorting Data (ORDER BY)  

...and the next video at:

   • From Excel to SQL - Top Rows, Distinct Row...  

---------------------------------------------------

CHAPTERS

00:00 Intro
00:28 Comments in Excel
01:40 Comments in SQL
04:11 Why bother with -- comments?
06:05 Why bother with /**/ comments?
08:25 Wrap up