Odd INSERT issue

karen01179

New Member
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!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.
 
Back
Top