Home SAP HANA How to create SAP HANA SQL Synonym

How to create SAP HANA SQL Synonym


Hello everyone in this blog you will learn to create SAP HANA SQL synonym in SAP HANA. Lets get started.

What is SAP HANA SQL Synonym

SAP HANA SQL Synonym is an alternative name created for a table, view, procedure and sequence in SAP HANA. There are two types of synonyms

  • Private Synonym
  • Public Synonym


You should have a table (or) view (or) procedure (or) sequence created in a schema


Synonym can be created by using following SAP HANA SQL syntax

CREATE [PUBLIC] SYNONYM <synonym_name> FOR <table_name> or
<view_name> or
<procedure_name> or

Step-by-Step Procedure

1. Login to SAP HANA Studio.

2. Identify the table for which you want to create a Synonym. In this example i am going to create a synonym for the table “ARTCILE_INFO” which is in the schema “SAPLEARNERS”.

SAP HANA SQL Synonym Step_1

3. Right click on the table and choose New Synonym.

SAP HANA SQL Synonym Step_2

4. Provide the synonym name and click on Execute. Select Public checkbox to create a public synonym (or) leave it blank to create a private synonym. In this example i am creating a private synonym “SY_ARTICLES”.

SAP HANA SQL Synonym Step_3

5. After executing, a new private synonym will created successfully in the Synonym folder in the schema.

SAP HANA SQL Synonym Step_4

6. If you have selected the check box Public while creating the synonym in Step-4, a public synonym will be created in Public Synonym folder.

SAP HANA SQL Synonym Step_57. Now you can directly the query on the table with synonym name as below


Congrats! You have successfully created Synonym in SAP HANA. Please stay tuned for SAP HANA tutorials. Leave a comment in the below comment section and let us know your feedback.


WordPress database error: [Table 'saplearn_wp1.wp_nsex_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_nsex_comments.comment_ID FROM wp_nsex_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2450 AND comment_parent = 0 ORDER BY wp_nsex_comments.comment_date_gmt ASC, wp_nsex_comments.comment_ID ASC


Comments are closed.