Answers for "tsql rename column name"

SQL
3

tsql rename table

-- SQL SERVER -- don't put the schema in the 'new_name' field, otherwise your table might end up looking something like schema.schema.new_name
EXEC sp_rename 'schema.old_name', 'new_name';
Posted by: Guest on October-08-2021
10

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'
Posted by: Guest on May-04-2021
0

tsql rename column name

sp_rename 'table_name.old_column_name', 'new_column_name', 'COLUMN';
Posted by: Guest on February-17-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language