SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Change Data Structures Using HDBTABLE and HDBMIGRATIONTABLE Objects

Change data structures by adding columns to a table using HDBTABLE and HDBMIGRATIONTABLE objects.

Overview

You will learn

  • How to change table definition in an HDBTABLE object
  • How to recreate the table using an HDBMIGRATIONTABLE object
  • How to change table definition in an HDBMIGRATIONTABLE object
  • How to insert migration definition in an HDBMIGRATIONTABLE object Are you wondering what the best way is to manage changing data structures? Do you want to know how to collaborate more efficiently when working in development projects?
Thomas Jung T Thomas Jung August 21, 2026
Created on October 19, 2021
Contributors

More from Thomas Jung

See all 228 tutorials by Thomas Jung →

Prerequisites

Prerequisites

Steps

Intro

To answer the first question, learn what benefits different table types in SAP HANA Cloud, SAP HANA database can offer you based on your needs. The following 3 tutorials in this tutorial group will help you navigate through your challenges with the managing data structures:

  1. Get started to collaborate in SAP Business Application Studio

  2. Import data into a table in SAP HANA Database Project

  3. You are here Change data structures using HDBTABLE and HDBMIGRATIONTABLE objects

    To answer the second question, create template projects that help you set up service connections, handle synonyms and prepare authorization management. You can create these templates once in the beginning and give your project team members a head-start. Using the template, they can build on your work and can quickly start working productively.

    The following 4 tutorials in this tutorial group will help you learn how to collaborate efficiently:

  4. Prepare your SAP HANA Database Project for collaboration

  5. Generate users and roles for assigning privileges

  6. Enhance your project with services, synonyms, and grants

  7. Collaborate on an SAP HANA Database Project template

This tutorial will show you how to change data structures using HDBTABLE and HDBMIGRATIONTABLE objects.

Step 1 Change data structures using `HDBTABLE` and `HDBMIGRATIONTABLE` objects

Now that your table is created and the data is imported, we will change the structure of this table by adding two columns. You can then examine in the terminal how this type of object handles data structure changes, which we will compare to other table types later.

  1. Go back to SAP Business Application Studio and select your inventory.hdbtable.

  2. Add two columns to the table definition by copying the following code and pasting at the end of the line 30.

SQL
"ADDITIONALATTRIBUTESTRING" NVARCHAR(10),
"ADDITIONALATTRIBUTESTRINGNN" NVARCHAR(10) NOT NULL DEFAULT 'TEST'
Make sure to paste these lines in between the last column definitions and the closing parenthesis `')'` in **line 31**. The last previous line of column definitions needs to have a ',' at the end.

The new table definition should look like this image:

![Add columns HDBTABLE](https://raw.githubusercontent.com/sap-tutorials/Tutorials/master/tutorials/hana-cloud-collaborative-database-development-3/ss_01_add_columns_HDBTABLE.png)
  1. Now you can deploy this updated object again to your database by clicking on the
    Deploy
    Deploy
    deploy icon in the SAP HANA Projects panel. You can either deploy only the file inventory.hdbtable or the whole project.
Step 2 Verify the changes to the data structure using Database Explorer
+
Step 3 Recreate the table using an HDBMIGRATIONTABLE object
+
Step 4 Change table definition in HDBMIGRATIONTABLE object
+
Step 5 Insert migration definition in HDBMIGRATIONTABLE object
+
Step 6 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 6
1. Change data structures using `HDBTABLE` and `HDBMIGRATIONTABLE` objects 2. Verify the changes to the data structure using Database Explorer 3. Recreate the table using an HDBMIGRATIONTABLE object 4. Change table definition in HDBMIGRATIONTABLE object 5. Insert migration definition in HDBMIGRATIONTABLE object 6. Test yourself
Next