Skip to Content
1
Former Member
Jul 29, 2014 at 08:16 PM

RENAME Column in SQLScript

127 Views

I am using the SAP HANA web editor and am trying to essentially shift/rotate columns in a database table. Essentially I want to shift the contents of column 1 to column 2, column 2 to column 3, ... column n-1 to column n. One idea that was already tried and works would be to use an update statement to shift the columns, but there is concern that this may not be the best option performance wise. So, another thought was to rename the columns, so that none of the data actually gets shifted, just that the name of the column changes to what it would have been moved to. Where this logic needs to go is in an existing stored procedure that is using SQLScript. This does not seem to work though in a stored procedure. I get the following error: "Syntax error in procedure object: RENAME OBJECT is not allowed in SQLScript". Does anybody know of any workarounds for this? Or, can anybody suggest if there is an option that is better than copying the data from one column to the next?