How to comments SQL Statements and Identifiers Concept in SAP HANA


If you want to add comment in your HANA SQL statement  to improve the readability and maintainability, so comments are delimited in SQL statements as follows: 

  • Double hyphens "--". Everything after the double hyphen until the end of a line is ignored by the SQL parser.

  • "/*" and "*/". This style of commenting is used to place comments on multiple lines. All text between the opening "/*" and closing "*/" is ignored by the SQL parser.


 Used to represent names in in SQL statements including table name, view name, synonym name, column name, index name, function name, procedure name, user name, role name and so on.


     Types of Identifiers:

1. Undelimited Identifiers: Name can start with only a letter and cannot contain any symbols other digits or an underscore "_".
2. Delimited Identifiers: It enclosed in the delimiter double quotes and identifier can contain any character including special characters. example "TAK$%LK" is a valid identifier.


  1.  "_SYS_"  is reserved exclusively for database engine and is therefore not allowed at the beginning of scheme objects names.
  1.  The maximum length for identifiers is 127 characters.      
  1.  Identifiers are case sensitivity so it is recommendation  is to standardize to using double quotes  around all the identifiers in SQL Statements where ambiguity may be a concern       

#comment in sql hana #sql #database#comment#com#query#script#sap#viewer#comments#data