Groups | Blog | Home
all groups > sql server clients > april 2004 >

sql server clients : adding a column to a db in use


lisa
4/30/2004 7:22:32 AM
Is it ok for me to add a column while the database is in
use? My users received a message when I added the first
column to an existing table. Is there a way to stop them
sanchans NO[at]SPAM online.microsoft.com
4/30/2004 6:31:34 PM
I would recommend that we don't add any columns to a table while it is in
use. From the perspective of best practices, I would recommend that you
keep designing/alteration of tables and database separate from your
production environment.

I am not aware of your environment, however, if it is a large database on
production environment, it is rare that someone will add a column in a
table while the database is still accessible. This is typically a
maintenance/change request kind of a scenario and should be first done on a
test environment. Once you have tested the new table structure and are sure
that its ready for production environment, then you can put that table
there. But make sure that all this is done when there are least chances of
any users getting hit.

Right now, your users just got some error message. However, if you simply
add a new column directly in the production database table, your
application might start behaving abnormally, affecting your users. So my
suggestions would be that you add it separately on a different machine
before putting it on live server.

Hope that helps.

Sanchan[MSFT]

sanchans@online.microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights.
Hari Prasad
4/30/2004 9:03:40 PM
Hi,

Database in use is fine. But do not add a column if the table is in use.
This will lock all the users accessing the table, so do it offline

Thanks
Hari
MCDBA

[quoted text, click to view]

AddThis Social Bookmark Button