Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Null values

Author  Topic 

vicki
Posting Yak Master

117 Posts

Posted - 2002-02-21 : 10:28:42
I have table Employees design like:
ColumnName: EmployeeID (Pk)
Datatype: Int
Length: 4
Allow Nulls: (not check-not allow nulls)

but when I insert the value into the employees table through the form from he web page then I have the error:
"Cannot insert the value NULL into column 'EmployeeID', table Employees.dbo.Employees; column does not allow nulls. INSERT fails."

I don't know why some how EmployeeID was not set the automatic number like in SQL 6.5 ?, I wan to have this field is automatic number like for evertime insert new record into the datbase. I make it work in in access or 6.5, but in 2000 why I can't make it work?
Thanks


izaltsman
A custom title

1139 Posts

Posted - 2002-02-21 : 10:40:02
You forgot to set the IDENTITY property for that field.

Go to Top of Page

vicki
Posting Yak Master

117 Posts

Posted - 2002-02-21 : 10:52:33
Oh yup, I totally forgot this

Thanks alot

Go to Top of Page
   

- Advertisement -