Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Mohamed Faisal
Yak Posting Veteran
51 Posts |
Posted - 2012-10-13 : 04:53:42
|
Hi,I would need a help. I Alter a Table to create a new column:ALTER CTTableAdd abc Char(3) null;But the problem is that i need the column to be not Null. how to i go about making it not null. |
|
malpashaa
Constraint Violating Yak Guru
264 Posts |
Posted - 2012-10-13 : 06:09:04
|
Try something like this:UPDATE CTTable SET abc = '' --replace '' with your default value. WHERE abc IS NULL;GOALTER TABLE CTTable ALTER COLUMN abc CHAR(3) NOT NULL; For us, there is only the trying. The rest is not our business. ~T.S. EliotMuhammad Al Pasha |
|
|
|
|
|