It copies it off to temp tables.
Something like this:
select * into #Hold from OriginalTable
create table NewTable (fields...)
insert into NewTable
select Fieldlist from #Hold
Of course, it also drops and recreates constraints, etc.
When in doubt, check out the Books Online,
it's a GREAT source of information!
> drops and recreates the table, so what about all the data in there?
> > If you do it within Enterprise manager you can, but that's only because
> > drops and recreates the table, which is what you would have to do with
> > to accomplish what you want.
> > --
> > Zach
> > ---
> > When in doubt, check out the Books Online,
> > it's a GREAT source of information!
> > > Is there a way to alter a table so that I can add a column, but not to
> > > end of the table?
> > > For instance:
> > > CREATE TABLE users(
> > > user_id int not null primary key identity(1,1),
> > > username varchar(50),
> > > date_created datetime not null default current_timestamp
> > > )
> > > GO
> > > Now, I want to add columns, FNAME and LNAME, but I don't want them to
> > > columns after the date_created as
> > > I'd still like to have the date_created column the LAST column in the
> > table.
> > > Is it possible to now, once the table has been created, and populated
> > > data, add in FNAME and LNAME
> > > so that my table now appears like
> > > user_id, username, fname, lname, date_created
> > > ??
> > > Thanks
> > > Paul