Monday, March 19, 2012

ALTER TABLE Add <column>

Hi,
I would like to add a column using the ALTER TABLE command. That works fine
and the column is added at the end of the table. But I would prefer if it
was added somewhere in the middle. How could I do that?
Here is my code:
ALTER TABLE bdok_schueler
ADD skz VARCHAR(6);
Thanks,
PhilippI dont think you can specify the position.
There is a good post relating to this here:
http://mcse.ms/arch/72/2003/11/964612
Cheers,
James Goodman MCSE, MCDBA
http://www.angelfire.com/sports/f1pictures|||Hi,
We can not do this from Query Analyzer.
If we do it from Enterprise manager, it actually does below steps,
1. Export the data out
2. Drop the table
3. Create the table (includes the new column based on the location you have
given)
4. Load the data back
Thsi step will take a long time incase the table data size is huge.
Thanks
hari
MCDBA
"Philipp Rthl" <REMOVEphilipp.roethl@.intercom.at> wrote in message
news:40169246@.e-post.inode.at...
quote:

> Hi,
> I would like to add a column using the ALTER TABLE command. That works

fine
quote:

> and the column is added at the end of the table. But I would prefer if it
> was added somewhere in the middle. How could I do that?
> Here is my code:
> ALTER TABLE bdok_schueler
> ADD skz VARCHAR(6);
> Thanks,
> Philipp
>

No comments:

Post a Comment