Rename object not supported in Azure SQL Data Warehouse?

[Posting a question from a client on an internal topic]

I tried to run the following commands in SQL DW:

RENAME OBJECT dbo.test TO test2 RENAME OBJECT test TO test2 

Both refused with the following error:

 No item by the name of '[DemoDB].[dbo].[test]' could be found in the current database 'DemoDB', given that @itemtype was input as '(null)'. 

Is this a defect or is there a workaround that I can use?

+5
source share
2 answers

RENAME is now supported. To use the rename object, you must prefix the table you want to change with the schema name as follows:

RENAME OBJECT x.T_New TO T;

Note that there is no circuit qualification for the target. This is because the renamed object must continue to be inside the same schema. To transfer a table from one schema to another, you need to use the following command:

ALTER SCHEMA dbo TRANSFER OBJECT :: x.T_NEW;

+4
source

RENAME is now supported. To use the rename object, you must prefix the table you want to change with the schema name as follows:

RENAME OBJECT x.T_New TO T;

Note that there is no circuit qualification for the target. This is because the renamed object must continue to be inside the same schema. To transfer a table from one schema to another, you need to use the following command:

ALTER SCHEMA dbo TRANSFER OBJECT :: x.T_NEW;

0
source

All Articles