473,472 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

drop 'Not Null' constraint

Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...

Thanks

Oct 10 '06 #1
5 8791
I'm afraid that--outside of perhaps using the ALTOBJ stored
procedure--you'll have to drop the table.

http://groups.google.com/group/comp....302969f3dea192

--Jeff

an*************@gmail.com wrote:
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...

Thanks
Oct 10 '06 #2
an*************@gmail.com wrote:
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...
After upgrading to DB2 9? Good, do that.
Then run ALTER TABLE ALTER COLUMN
followed by a REORG.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Oct 10 '06 #3
It's DB2 V8.2. Not sure when the upgrade to V9...

any short cut in V8.2 for droping Not Null constraint?

THanks

Serge Rielau wrote:
an*************@gmail.com wrote:
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...
After upgrading to DB2 9? Good, do that.
Then run ALTER TABLE ALTER COLUMN
followed by a REORG.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Oct 10 '06 #4
an*************@gmail.com wrote:
It's DB2 V8.2. Not sure when the upgrade to V9...

any short cut in V8.2 for droping Not Null constraint?
That makes ALTOBJ() your second last option I suppose. ;-)
No shortcut.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Oct 11 '06 #5
an*************@gmail.com wrote:
Is there any command (alter table ...?) to drop 'Not Null' constraint
on a column? I have a column CODE which has 'Not Null' constraint
defined and I want to drop 'Not Null'. Please let me know.

Droping the table and recreating would be my last option...

Thanks
That depends how it was ADDed.

If the NOT NULL CONSTRAINT was ADDed manually, a standard ALTER TABLE
<table nameDROP CONSTRAINT <constraint name>; should do the trick. If
it was added automagically, others have responded.

Just another reason to do things manually.

B.

Oct 16 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marion Jakob | last post by:
hi i'm using mssql server 2000 i want to remove a not null column constraint from the column answertext in table answertext. i tried the following line ALTER TABLE AnswerText ALTER COLUMN...
2
by: James Knowlton | last post by:
Hello, I'm just returning to MS SQL Server after two years of dealing with Sybase ASE. I need to drop a column, using the alter table command. I keep getting an error indicating that a...
2
by: T.S.Negi | last post by:
Hi there, I have created a hash table. After using it, somehow the primary key constraint of this hash table still exist in database. Which cause error. When I delete this constraint with...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
10
by: hilz | last post by:
Hi all. I have a table that i create in MsAccess, using ado connection as follows: create table PAYITEM ( PAYITEM_ID COUNTER PRIMARY KEY, PAYITEM_NAME ...
1
by: Thomas Chille | last post by:
Hello! I have a Problem. A table with a ForeignKeyRef exits. The Name of the field with this FK-Constraint is 'id_employee' because it is referencing the field 'id_employee' in...
3
by: dgirdhar | last post by:
Hello, I created one table say "Table1" with one column say "Column1" with constraint Not Null. Oracle generated its own name for this constraint. Say SYS_C#########. I want to delete this...
0
by: okonita | last post by:
DB2v8.2 LUW. Unable to drop Foreign Key constraints...although DROP constraints returns undefined name. Am I missing somrthing here? Hi all, I have a perplexing DB2 Drop command situation....
1
by: KingofGing | last post by:
Hi All, I'm having a problem writing an SQL statement that I can't quite wrap my head around. First, the background: I have a journal subscription system including 3 tables, tblSubscription,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.