How to rename a table column name in Azure Synapse?

Mangesh Barmate 6 Reputation points
2022-06-23T04:00:53.82+00:00

Hi,

Unable to rename a table column name. Please help.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,183 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,541 Reputation points
    2022-06-23T12:40:22.57+00:00

    Hello @Mangesh Barmate ,

    Welcome to the Microsoft Q&A platform.

    sp_rename (Transact-SQL) - This feature is in Preview for columns in user tables.

    Note: In Azure Synapse Analytics, sp_rename is in Preview for dedicated SQL pools and can only be used to rename a COLUMN in a user object.

    Columns before Rename:

    54190-image.png

    The following example renames the MedallionID column in the tripoutput table to MID.

    EXEC sp_rename 'dbo.tripoutput.MedallionID', 'MID', 'COLUMN';  
    

    54338-image.png

    Columns after Rename:

    54387-image.png

    Hope this helps. Do let us know if you any further queries.

    ------------

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.