June 26, 2008 at 5:07 pm
Hello Everyone,
How can I add a new column (EMP_MID_NAME) between two existing columns (EMP_FIRST_NAME) and (EMP_LAST_NAME)?
Regards
June 26, 2008 at 5:19 pm
In Management Studio, right-click on the table, select "Modify", and insert the column. In T-SQL, you'll have to recreate the table and reload the data because ALTER TABLE ADD COLUMN only adds a column at the end.
Greg
June 27, 2008 at 3:25 am
Yep.... Greg Charles is True
June 27, 2008 at 10:20 am
Thank you Greg, I'm using SQL 2005 and upon right clicking on my table I don't see a Modify option, however I used Design option and I'm able to insert new columns at desired places.
Thanks again.
Zulf
June 27, 2008 at 10:25 am
zulfansari (6/27/2008)
Thank you Greg, I'm using SQL 2005 and upon right clicking on my table I don't see a Modify option, however I used Design option and I'm able to insert new columns at desired places.Thanks again.
Zulf
Behind the scenes the "old" table is dropped entirely and recreated with "position" where you asked it. It really does not matter the logical number where it "shows" in the UI. ALTER TABLE ADD COLUMN is a lot less invasive.
* Noel
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply