Creating a new table in SAP HANA

SAP HANASAPSQL

New tables can be created using the two methods given below −

  • Using SQL editor
  • Using GUI option

The new table can be created using SQL Create Table statement –

Create column Table Test1 (
   ID INTEGER,
   NAME VARCHAR(10),
   PRIMARY KEY (ID)
);

When you run this SQL query, you get a message like this:

The statement 'Create column Table Test1 (
ID INTEGER, NAME VARCHAR(10), PRIMARY KEY (ID) )'
successfully executed in 5 ms 136 μs (server processing time: 4 ms 432 μs) -
Rows Affected: 0

To create a table using GUI, you need to right-click on any schema name -> New Table

It will open a window to enter the Table name, Choose Schema name from the drop-down, Define Table type from the drop-down list: Column Store or Row Store.

Define data type as shown below. Columns can be added by clicking on the + sign, Primary Key can be chosen by clicking on the cell under Primary key in front of the Column name, Not Null will be active by default. Once columns are added, click on Execute.

raja
Published on 23-Apr-2018 11:16:27
Advertisements