How do you rename multiple columns in a table using SQL?

  Kiến thức lập trình

I need to merge some datasets and the tables need to match. The first one I did I used

ALTER TABLE table.name
Rename Column field1 to new_name1,
Rename column field2 to new_name2;

And

ALTER TABLE table.name
Rename Column field1 to new_name1 AND,
field2 to new_name2;

Neither method worked so I had to do each one individually which was a task since I had 12 columns to rename.
Is there another way to rename multiple tables at one time?

New contributor

Jan Keifer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT