Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 19, 2014 at 05:34 AM

    Hi Niveda-

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

    ALTER TABLE test_table DROP (column_name);

    Thanks😊

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 :-)

  • avatar image
    Former Member
    Dec 19, 2014 at 05:30 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 30, 2015 at 10:45 AM

    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");

    Add comment
    10|10000 characters needed characters exceeded