View previous topic :: View next topic
|
Author |
Message |
mailsaurabh.tripathi
New User
Joined: 22 May 2008 Posts: 56 Location: hyderabad
|
|
|
|
can we add a column of CHAR(4) not null, to an exsisting table in production environment?plz give ans with reason |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
yes, and the reason is for you to provide. why do you need an additional column. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Saurabh,
You can use following query
ALTER TABLE tablename
ADD colname CHAR(4) NOT NULL WITH DEFAULT X'05';
But u need to specify default value since table already contain data |
|
Back to top |
|
|
|