Forum Discussion
Renaming columns and adding columns
- Anonymous2 years ago
Hi ebjim
Thanks for using Fabric Community.
Yes you are right. Currently rename a table in lakehouse, and ALTER table functions, adding new columns in a Lakehouse table is not supported in Fabric.
sp_rename is supported for Tables, Stored Procedures , Views and Functions in Warehouse. It is supported only for objects not for columns.Hope this helps. Please let me know if you have any further questions.
- 2 years ago
You can change the schema of a lakehouse table by using a notebook and advancing the schema if your table is a delta table. The lakehouse sql endpoint won't let you do any schema (or data) modifications.
It seems to me that you can use overwriteSchema for renaming columns (and other schema changes):
That implies doing a full overwrite of the table data as well.
For adding columns I think you can use this generic code:
%%sql
ALTER TABLE tableName
ADD COLUMN columnName columnType;
The way I understand it, this is just a metadata operation and does not imply a full overwrite of the data.