Skip to Content

Alter Command in SQLScript SAP HANA

Hello Everyone,

I am trying the execute Alter command using SQL Console to change the Column type from NVARCHAR to SMALLINT in SAP HANA but i am getting the below error -


SAP DBTech JDBC: [7]: feature not supported: cannot modify column type from nvarchar to smallint: ID: line 1 col 31 (at pos 30)

is there any way out to rectify the above . SAP HANA Version SPS09.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 10, 2016 at 08:01 AM

    Hello Shivam,

    in general altering the table column type from nvarchar to smallint is possible in case the values of the column can be converted to smallint (e.g. no characters, integers in smallint integer range, ...).

    But it is not possible if the column is a key column. In that case the type conversion is not possible. As your column is called "ID" i assume that you try to change the type of a primary key column which is not possible.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Florian ,

      Thanks for your reply , i executed the alter command on non key columns and find it working as i want ,

      As you said if its convertible to smallint then only it will execute else it will throw attribute modify error .

      Thanks a lot 😊 .



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.