Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Null

Status
Not open for further replies.

Bell1991

Programmer
Aug 20, 2003
386
US
I need to insert a null value into a table..

My table only has one field so i declared it as not null - but a null value is unique and i know it can be done.

If i use Enterprise Manager and try to insert a null value i enter <null> i get This cell contrains the text string <null>. You can press Ctl+0 inside the cell to replace it with a NULL value. Do you want to replace this entry now?

If i do an insert command:

Insert into tblTest values (NULL) i get an error message: Cannot insert the value null into column - column does not allow null.

Is inserting <null> the same as NULL?

If not - how do i insert a null value into the table?

Thanks

 
If you only have one field in the table you don't need to insert a row with a NULL value, it does not make sense. If there is a value then you insert a row, it not no need to insert.
 
It can't be done if you specify the field as NOT NULL.
-Karl

[red] Cursors, Triggers and User Definded Functions are part of the Axis of Evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top