Re: Alter table via t-sql vs Ent Manager
From: Hari (hari_prasad_k_at_hotmail.com)
Date: 05/20/04
- Next message: RBurton: "Re: Perfmon logging to SQL database - slow retrieval"
- Previous message: mid: "Alter table via t-sql vs Ent Manager"
- In reply to: mid: "Alter table via t-sql vs Ent Manager"
- Next in thread: mid: "Re: Alter table via t-sql vs Ent Manager"
- Reply: mid: "Re: Alter table via t-sql vs Ent Manager"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 May 2004 15:14:17 +0530
Hi.
Difference:
If you do change in table structure using EM then:-
1. Unload the data
2. Drop the table and dependants (indexes)
3. Create the table with new definition
4. Create dependant objects
5. Loads back the data and delete the file.
If You do it Query Analyzer using ALTER TABLE then:-
1. It just directly changes the definition or adds a new column.
So it is allways advisible to change the table definition using Query
ANalyzer -- ALTER TABLE command. Since this activity is
logged we can revert back if the database is set in FULL recovery model.
As well as it is very fast, only disadvantage is using alter Table you cann
add a new column only at the last.
Thanks
Hari
MCDBA
"mid" <midbarsinai@midbarnospam.org> wrote in message
news:1ar8ck4gwbl0l.dlg@midbarnospam.org...
> Hello all!
>
> What is the difference between running a alter table statement that adds a
> new column to a sql server 2000 table using Query Analyser or Enterprise
> Manager?
>
> I noticed that if we do it using Ent. Manager it creates a big script that
> copies the whole table to a temp table, adds the new column and than
> renames it to the original table dropping the old one.
>
> If we do it using QA we just need a "ALTER TABLE X ADD ..."
>
> Question IS:
> Is EM preferable, more reliable?
> Is QA safe in the case of a server failure while running the query. What
is
> the fastest/reliable method if I want to add a column to a 13 milion
record
> table?. BOL states that alter table statements are logged a fully
> recoverable. This recovery would be automatic or would require any manual
> statements?
>
> Very confused as you see...
>
> TIA
> mid
- Next message: RBurton: "Re: Perfmon logging to SQL database - slow retrieval"
- Previous message: mid: "Alter table via t-sql vs Ent Manager"
- In reply to: mid: "Alter table via t-sql vs Ent Manager"
- Next in thread: mid: "Re: Alter table via t-sql vs Ent Manager"
- Reply: mid: "Re: Alter table via t-sql vs Ent Manager"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|