Double-Hyphen Style Comments

This comment style begins with two consecutive hyphens followed by a space (-- ) and terminates with a new-line character. Therefore, you cannot use multiple-line comments.

SAP ASE does not interpret two consecutive hyphens within a string literal or within a /*-style comment as signaling the beginning of a comment.

To represent an expression that contains two consecutive minus signs (binary followed by unary), put a space or an opening parenthesis between the two hyphens.

Following are examples:

-- this procedure finds rules by user name 
create procedure findmyrule @nm varchar(30) = null 
if @nm is null 
  print "You must give a user name" 
  print "I have returned" 
-- each line of a multiple-line comment 
-- must be marked separately.
else        -- print the rule names and IDs, and 
        -- the user ID 
  from sysobjects, master..syslogins 
  where = @nm 
  and sysobjects.uid = master..syslogins.suid 
  and sysobjects.type = "R"