cancel
Showing results for 
Search instead for 
Did you mean: 

how to delete one entire column from table using sql editor in sap hana

Former Member

how to delete one entire column from table using sql editor in sap hana

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member

Hi Niveda-

To delete/remove a column from the table the below syntax can be used:

ALTER TABLE test_table DROP (column_name);

Thanks

Former Member
0 Kudos

Hi Manikandan,

Thanks for your reply. But I have tried the following two options. it is not working. I am getting syntax error.

i) ALTER TABLE test_table DROP (column_name);

ii) ALTER TABLE test_table DROP COLUMN(column_name);

Thanks 🙂

rajnish_tiwari2
Advisor
Advisor
0 Kudos

table creation

create table T1 (a nvarchar(2), b nvarchar(2));

Insertion of Data into the column

insert into T1 values('1','2');

insert into T1 values('3','4');

Output:

select * from T1;

Now drop the column A syntax

alter table T1 drop ("A");

Former Member
0 Kudos

Could you please paste the syntax and the error you are getting?

Former Member
0 Kudos

Hi

I tried your syntax by enclosing the column name in braces (). It worked.

Thank you.