tirtha basu
tirtha basu

Reputation: 11

renaming table and columns and Transfer schema in synapse pool

I am trying to transfer table from one schema to another and rename objects in synapse pool dw database.

  1. ALTER SCHEMA <new_schema> TRANSFER OBJECT::<old_schema>.<table_name>;

    Msg 15151, Level 16, State 1, Line 4 Cannot find the object '<table_name>', because it does not exist or you do not have permission.

    Completion time: 2020-10-13T08:06:00.9254770-04:00

    I get the error above; however I have proper permissions to rename. Is there any suggestion.

  2. rename object <schema_name>.<table_name> COLUMN <column_name> to <column1_name>

    I am getting the below error:

    Msg 103010, Level 16, State 1, Line 2 Parse error at line: 1, column: 66: Incorrect syntax near 'COLUMN'.

    Completion time: 2020-10-13T07:32:10.5444563-04:00

MSDOCS article followed is https://learn.microsoft.com/en-us/sql/t-sql/statements/rename-transact-sql?view=aps-pdw-2016-au7

Upvotes: 1

Views: 2336

Answers (2)

Kevin Kelly
Kevin Kelly

Reputation: 1

Having proper permission to rename does not guarantee permission to move the table into a different schema. This requires "alter" permission on schema <new_schema> and control permission on the table being moved (<old_schema>.<table_name>)

see https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-schema-transact-sql?view=aps-pdw-2016-au7#permissions

Upvotes: 0

HarithaMaddi-MSFT
HarithaMaddi-MSFT

Reputation: 551

  1. Below command worked fine for me, check it

enter image description here

  1. It applies only to PDW and not Synapse as per "Applies to" section in the document

enter image description here

Upvotes: 1

Related Questions