Professional Documents
Culture Documents
To Create Table:
create column table "KABIL_PRACTICE"."DEMO"
(
"ID" integer,
"NAME" Nvarchar(35)
);
Note:
For column table, only increasing the size of a column data type is allowed to prevent data loss.
For example, changing from NVARCHAR (20) to NVARCHAR (10) or from INTEGER to TINYINT
raises an error.
For row table, only increasing the size of VARCHAR and NVARCHAR type column is allowed. Other
data type changes are not allowed.
Example:
To add a Salary column:
Alter table "KABIL_PRACTICE"."DEMO" Add ("Salary" Decimal(10,2));
Adding a NOT NULL constraint to an existing column is allowed if either of the following cases
are true:
COMMENT ON:
This statement is used to add descriptive comments to tables, views or their individual columns in
SAP HANA system.
Comments are a useful way to record a meaningful description of schema tables/views, and their
columns, for future reference.
Examples:
To create COMMENT ON for DEMO table in
“KABIL_PRACTICE” Schema
COMMENT ON TABLE "KABIL_PRACTICE"."DEMO" IS 'DEMO Table for Alter
Statements';
Note:
we can see this comment by Right click your table from the corresponding schema and
click open definition. A new tab will open from that select Further Properties, you can see
the comment of your table.
To Remove comment on Table
COMMENT ON TABLE "KABIL_PRACTICE"."DEMO" IS null;
Note:
we can see this comment by Right click your table from the corresponding schema and
click open definition. A new tab will open with that comment will be shown in the
corresponding column.
To Rename Column
Rename column "KABIL_PRACTICE"."DEMO"."ID" To "E_ID";
To Rename Table
Rename Table "KABIL_PRACTICE"."DEMO" To "DEMO_TABLE";
https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.00/en-US/
f327b70cae564c53a766367a8aad0164.html