I am often asked how to rename a column in an
existing (SQL) table.
First of all I want to warn that one should be careful when changing column names in existing tables as the changes can affect scripts, functions and procedures written for the database.
First of all I want to warn that one should be careful when changing column names in existing tables as the changes can affect scripts, functions and procedures written for the database.
The queries to change column names are fairly easy
to understand, but the syntax used for SQL Server, MySQL and PostgreSQL differs
from each other..
The basic queries for the three database systems
are as follows:
PostgreSQL
MySQL
Example:
No comments:
Post a Comment