Jump to content

alter table add column ... like this other column over here?


Go to solution Solved by Barand,

Recommended Posts

I want to alter a table and add a new column.

 

I want to add a second email address column and I want the design of this new column to match with the first.  For example, if

email varchar(128) default null

then I want the new column the "same" as in:

email2 varchar(128) default null

Can column design values be copied in this way within the sql construct?

 

Can column design values be collected from another separate table?

  • Solution

You can create a table which has exactly the same structure as another

CREATE TABLE table2 LIKE table1;

I know of nothing similar down at the ADD COLUMN level.

Edited by Barand
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.