filipniziol
Esteemed Contributor

Hi @Nid-cbs ,

It depends on how you are using the code.
Make sure you are using .sql notebook type or %sql magic command, and not spark.sql.
Also, the owner should be wrapped in ` backtick characters:

 

%sql
ALTER TABLE test_table SET OWNER TO `owner`

 

More on that:
https://stackoverflow.com/questions/68804903/databricks-alter-table-owner-to-userid-is-not-working-w...