Matheus Leão
Matheus Leão

Reputation: 437

SQL syntax error when trying to alter column dimension?

I'm a complete SQL newbie. I want to modify the dimension of columns on a table stored in the cloud. Table 'T_PERSONS' has only 3 simple columns, 'ID', 'FIRSTNAME' and 'LASTNAME' all set to size 1 by default (for some reason). Database system is Hana MDC I believe.

My code:

ALTER TABLE T_PERSONS
ALTER COLUMN FIRSTNAME VARCHAR(255);

I get:

(SQL Editor) Could not execute 'ALTER TABLE T_PERSONS ALTER COLUMN FIRSTNAME VARCHAR(255)'
Error: (dberror) 257 - sql syntax error: incorrect syntax near "COLUMN": line 2 col 6 (at pos 29)

Edit: Also, the table is empty.

Upvotes: 0

Views: 1752

Answers (1)

Matheus Leão
Matheus Leão

Reputation: 437

Seems like SAP Hana uses another syntax.

alter table XXX.YYYYYYYYY alter ("DESC" NVARCHAR(500));

Credit to leosf6308.

Upvotes: 3

Related Questions