Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HELP: How to modiry a null column into a NOT NULL.

0 views
Skip to first unread message

Truong Phan

unread,
Mar 16, 1998, 3:00:00 AM3/16/98
to

Hi Netters,

Is there anyway can I alter a column of a table from NULL to NOT NULL.
Please email to me for any responses.

BTW, is it possible to add a NOT NULL column to an existing table which has
data in its.
--
Truong Phan

============================================================================
==
Truong Quang Phan
Chip Application Technologies (C.A.T)
Voice: 61 2 9332 4955
Fax: 61 2 9332 3711
Email: tru...@usa.net, tru...@cta.com.au
============================================================================
==
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Chip
Application Technologies Limited.

Michael Mosler-Krings

unread,
Mar 16, 1998, 3:00:00 AM3/16/98
to

Truong Phan wrote:

Sorry!

But as far as I know the features of SQL-Server both things are impossible.
Perhaps you could add a new column allowing NULL and using a default.
Afterwards you can set the value for all existing columns to this default!

Don't know if this helps!

Michael


FCrombez

unread,
Mar 19, 1998, 3:00:00 AM3/19/98
to

Hello,


>
> Is there anyway can I alter a column of a table from NULL to NOT NULL.
> Please email to me for any responses.

It is possible to make the setting "allow null" (ex. by Sybase Central or
by sql-statement)
But first, you have to check if the column is filled up for every row,
record !!
Then , you can change the property !!

By sql statement :

alter table <table> modify <column> not null


In the past, I have already had such situations....

>
> BTW, is it possible to add a NOT NULL column to an existing table which
has
> data in its.

No ! First add the column to the table, fill up with data and then change
to 'NOT NULL"

Filip Crombez

FCro...@dma.be

0 new messages