user123123123 user123123123 - 1 year ago 88
SQL Question

header row extraction and insertion in different tables using sql studio

I would like to extract the row header from a table and insert it in another table with the same number of columns and data type, how can i do it in sql studio without having to retype the whole headers again ?
header row

second table

Answer Source

You can use create table like

 CREATE TABLE new_tbl LIKE orig_tbl;

this create an empty table with the same column name of the orig_tbl

if you need to change the column name you can use alter table

ALTER TABLE your_table_name  CHANGE `Column 0`  `Extension Field 1` ;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download