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 Development (2000)
 tableobject

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-09-20 : 08:23:53
Anju writes "Dear All

i am facing problem to insert auto number in my table..whenever i am going to do it, it will give error "no null allowded in <fieldname>,insert failed.

pl tell what i change and where

regds- Anju Mamgain"

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2004-09-20 : 09:12:05
See Identity In books on line.

Jim
Users <> Logic
Go to Top of Page

gpl
Posting Yak Master

195 Posts

Posted - 2004-09-20 : 09:14:40
quote:
Originally posted by AskSQLTeam

Anju writes "Dear All

i am facing problem to insert auto number in my table..whenever i am going to do it, it will give error "no null allowded in <fieldname>,insert failed.

pl tell what i change and where

regds- Anju Mamgain"



In your table creation statement (or Enterprise Manager if you must) ensure that the column you are setting up to be an autonumber says NOT NULL, like this -

create table categories
(
ct_id int identity not null,
ct_name varchar(30)
)


Graham
Go to Top of Page
   

- Advertisement -