EXEC sp_rename not working in Azure Synapse

Sasha Sasha 200 Reputation points
2023-11-09T15:53:03.0633333+00:00

I am using the following code :

EXEC sp_rename  'oldname' 'newname'

and I am getting this error :

An insufficient number of arguments were supplied for the procedure or function sp_rename

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,373 questions
0 comments No comments
{count} votes

Accepted answer
  1. Amira Bedhiafi 33,071 Reputation points Volunteer Moderator
    2023-11-09T15:56:40.5366667+00:00

    The sp_rename is still in preview in Azure Synapse Analytics.

    For now, you can only rename columns : https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-rename-transact-sql?view=sql-server-ver16

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Mauricio Cadena 5 Reputation points Microsoft Employee
    2023-11-09T16:53:08.5333333+00:00

    If you are looking to rename objects like a table, you can use RENAME (T-SQL)

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

    1 person found this answer helpful.
    0 comments No comments

  2. Nandan Hegde 36,146 Reputation points MVP Volunteer Moderator
    2023-11-09T15:55:04.7033333+00:00

    sp_rename is in preview in Azure Synapse Analytics:

    Applies to: Azure Synapse Analytics In sp_rename (preview) for Azure Synapse Analytics, COLUMN is a mandatory value specifying that the object type to be renamed is a column, and must always be included in the sp_rename statement. A column can only be renamed if it's not a distribution column.

    So it appears you can only rename columns at present.

    similar thread :

    https://stackoverflow.com/questions/77428611/insufficient-number-of-arguments-for-sp-rename-in-synapse-stored-procedure

    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.