Odd INSERT issue

Results 1 to 2 of 2

Thread: Odd INSERT issue

  1. #1
    Join Date
    Dec 1969

    Default Odd INSERT issue

    I just encountered something strange that I do not fully understand. I was trying to INSERT in to the database. I had 6 fields. 2 of the fields were datetime fields that I did not want to use in the INSERT statement. One is to track when the record was created and was set to getDate() by default. The other was named LastLogin and is used to track last login.<BR><BR>For whatever reason I was not allowed to INSERT in to the table unless I used every field (i.e. I needed to use the dates in the INSERT statement which meant nothing to me)<BR><BR>Why?<BR><BR><BR>Thanks in advance!

  2. #2
    Join Date
    Dec 1969

    Default RE: Odd INSERT issue

    If the date fields in the table are set to NOT NULL and there is no default entry for the fields in the database itself, the INSERT will fail. Maybe if you set the date fields to Allow NULL ( that can cause a lot of problems) or just set the fields default setting to getdate(). you can only leave out fields if theres a default set for them, or they allow NULLs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts