sql server 2000 is allowing null values in ''not null'' fields

  • I have recently ported my asp,access database to asp,mssql server.

    I am a newbee to ms sql server 2000. The problem i am facing is:

    When ever I am posting a record into my sqlserver 2000 through ASP interfacethe record is getting posted leaving an empty record before it. Some of the fields of the record are defined as "NOT NULL". Still this is happening and a blank record is getting added. What could be the problem. How do I Solve it. Pl Help

  • Empty string in varchar field <> Null.

    ASP code check "" before try to call insert.

  • Thanks Old Hand for Quick response.I agree that empty string is not null. I am checking. When I am posting only one record, two records are getting posted. One of them is an empty record completely except two fields which have default values.And another 2 fields((one is nvarchar, other smalldatetime) which are defined as 'not null' are empty in the table after the data has been posted online through asp interface. First, I don't know why record jumping is taking place with an empty record in between where as the same program did not behave absurd with ACCESS database.

  • Ok OldHand thankyou. I have solved the problem by checking the length of the string in the supposed to be null field. It has shown zero length. Then I created a constraint as "len(column name) >0" on the table. It did the trick!!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply