on 12-26-2014 4:20 AM
Hi ,
I have created a table with few columns and loaded the data.Now I would like to add a new column and load the data to it .Could you please let me know how to do it.
Hi Sreelatha-
There are some posts already related to adding/removing a column . Please check before posting a new thread.
Adding a new column:
ALTER TABLE <tablename> ADD (<columnname> <datatype>);
Example:
ALTER TABLE emp_t ADD(emp_id nvarchar(10));
Removing an existing column:
ALTER TABLE <tablename> DROP (<columnname> <datatype>);
Example:
ALTER TABLE emp_t DROP(emp_id nvarchar(10));
Thanks
Happy learning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I tried adding column to the table using Alter command and it was successful. But when I am trying to drop the column I am getting the syntax error.
alter table "ID42588"."CUSTOMER" add (custphone nvarchar(10));
alter table "ID42588"."CUSTOMER" drop (custphone nvarchar(10));
Error Message
sql syntax error: incorrect syntax near "nvarchar": line 1 col 50 (at pos 50);
Please help
Hi Sreelatha,
Please read some developer guides before posting a query like this.You can make use of SQL Scripts for performing this operations.
Please refer:UPDATE - SAP HANA SQL and System Views Reference - SAP Library
Regards,
Kannan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.