Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comment within views 1

Status
Not open for further replies.

davidsimpson

IS-IT--Management
Apr 28, 2003
1
GB
Hello
I'm new to SQL and want to be able to add comments to the views that I have built. How can I 'comment' out the text so it is not involved in the execution of the view.
thanks
 
Microsoft SQL Server allows two types of COMMENT markings.

The 'slash-asterick' comment marking is usually used for two or more lines and can be used in these styles:

/* your comments go here */

/* more than two lines
** here's a second line */

/* more than two lines
here's a second line */

I show the */ at the end of the line, but it can also be at the beginning of the last blank line:

/* start of comment
end of comment
*/

For one line, or comments within a script use two dashes:

--This is a comment line.

select *
--that selects all columns
from mytable mt
--the mt is an alias for mytable


-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top