Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql rename column

-- Oracle, MySQL 8+
ALTER TABLE table_name RENAME COLUMN current_name TO new_name;
-- MySQL < 8:
ALTER TABLE table_name CHANGE current_name new_name datatype(length);
-- SQL Server:
EXEC SP_RENAME 'table_name.current_name' , 'new_name', 'COLUMN'
Comment

how to rename column in sql

ALTER TABLE 'table_name'
RENAME 'old_name' TO 'new_name';
Comment

sql rename column

EXEC SP_RENAME 'TABLE_NAME.OLD_COLUMN_NAME','NEW_COLUMN_NAME'
Comment

rename a column in sql server

SQL SERVER
EXEC sp_RENAME 'TableName.OldColumnName' , 'NewColumnName', 'COLUMN'
Comment

SQL query rename table

EXEC sp_rename 'old_table_name', 'new_table_name'
Code language: SQL (Structured Query Language) (sql)
Comment

SQL Rename Column in a Table

ALTER TABLE Customers
RENAME COLUMN customer_id TO c_id;
Comment

sql rename column in select query

SELECT data.column AS `Label`
Comment

sql rename column in select

SELECT NAME AS "Employee Name" FROM PEOPLE;

SELECT p.NAME AS "Employee Name", s.SALARY AS "Employee Salary"
FROM PEOPLE p
JOIN SALARIES s ON p.ID = s.ID;
Comment

how to rename column name in sql server using query

EXEC sp_RENAME 'TableName.OldColumnName' , 'NewColumnName', 'COLUMN'
Comment

PREVIOUS NEXT
Code Example
Sql :: update sql sintax 
Sql :: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: 
Sql :: phone number regex sql 
Sql :: sql datum formatieren 
Sql :: call function in query sql server 
Sql :: sql server on mac m1 
Sql :: show tablespace oracle 
Sql :: sql order by number not ordered 
Sql :: Select with remove white spaces in sql 
Sql :: psql check if value in array 
Sql :: json not contains mysql 
Sql :: top 3 salary in sql 
Sql :: copy a table mysql 
Sql :: connecting to postgresql on windows amd ubuntu 20.04 
Sql :: mysql switch case 
Sql :: mysql last friday of current month 
Sql :: import database mysql command line 
Sql :: full outer join postgres 
Sql :: postgres get last value 
Sql :: T sql less than date 
Sql :: timestamp datatype in sql 
Sql :: get only one row in mysql 
Sql :: mysql pad zeros 
Sql :: find the all the constraints in a specific table 
Sql :: time in sql server 
Sql :: mysql get 2nd value in comma separated list 
Sql :: compress sql file database ubuntu 
Sql :: how to login to mysql in homestead 
Sql :: oracle create index if not exists 
Sql :: create table if not exists 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =