devxlogo

Quickly Comment and Uncomment Blocks of Code in SQL

Quickly Comment and Uncomment Blocks of Code in SQL

During development, it is often necessary to have blocks of code for debugpurposes. If the debug code is lengthy, commenting anduncommenting it can be tedious. But if you put either a ‘–‘ in front of each lineor a ‘/*’ at the front and a ‘*/’ at the end of each line, you can comment and uncomment the code block with a couple of keystrokes. Here are examples of each method:

Commented code

 /* Debug code goes in this blockPrint 'Some debug info'Print 'Some more debug info'--*/

Uncommented code

 --/* Debug code goes in this blockPrint 'Some debug info'Print 'Some more debug info'--*/

Just by adding or deleting two dashes at the beginning of the code block, theentire block can be commented or uncommented.

See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist