SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

Generate Create Table DDL SQL Script of SAP HANA Database Table

In this SAP HANA database tutorial, I want to share with SQLScript developers how to generate Create Table commands of selected HANA database tables. On SAP HANA Studio, this feature is now visible easily so I just wanted to provide this hint for SQL programers that require to extract DDL script of their database tables.

Since in general SAP tables have huge numbers of columns in HANA database, it is difficult to create these SQL statements manually.

Database developers frequently require CREATE TABLE SQL commands for selected database tables and in general they use the database's native database management tool to generate DDL scripts of those table. Database management tools provide DDL scripts for SQL database developers to let them Create those tables on other databases or backup the generated Create Table commands.

I recently require to generate a number of SAP HANA database tables' Create Table commands in order to execute these DDL statements on an other HANA database.

First launch SAP HANA Studio.
Using SAP HANA Development perspective, connect to the HANA database that you want to create DDL SQL scripts

Under catalogs find the related schema and under Tables node find your target database table.

SAP HANA database tables filtered on SAP HANA Studio

Double click on table name or right click on highlighted table name and from context menu choose "Open Definition"

When the table definition is displayed on a new screen, on the upper right corner, you will see the Export SQL icon. Click on it to export Create DDL SQL statement of the database table.

Export SQL for HANA database table Create DDL Statement

On a new SQL editor screen, automatically generated Create Table DDL SQLScript command will be displayed as follows

generate Create Table SQL statement for HANA table

Another option is using SAP HANA Studio Export Wizard especially if you have a quite number of database tables to generate SQL Create Table DDL statements or if you want to script HANA database tables with data stored in those tables.


Install SAP Free
CRM Companies List
Web Based CRM Software

Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.