TechnoLearnAcademy

TECHNOLEARN

SQL RENAME COLUMN

THE SQL has a standard stored procedure called SP_RENAME for renaming a column in an existing table.

Syntax:      

                   EXEC SP_RENAME ‘[table_name].[old column name]’ , ‘[New Column Name]’ , ‘COLUMN’

Example:

   Objective: In this example, we will be renaming the dept column to the department in the emp table. 
                    EXEC SP_RENAME ‘tbl_emp.dept’,’dept’,’department’;
Scroll to Top