how to rename in sql code example

Example 1: rename table sql

ALTER TABLE STUDENTS  
RENAME TO ARTISTS;

Example 2: cmd to rename a collumn name in sql

ALTER TABLE table_name RENAME COLUMN old_name TO new_name;

Example 3: modify column name in sql

ALTER TABLE `Table Name` MODIFY COLUMN `Column Name` Datatype(Size);

Example 4: rename column sql

ALTER TABLE nom_table
RENAME COLUMN colonne_ancien_nom TO colonne_nouveau_nom

Example 5: how to rename columns in sql server

EXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN';

Tags:

Sql Example