Forums
This topic is locked
insert record - skip the primary key?
Posted 20 Feb 2003 18:38:16
1
has voted
20 Feb 2003 18:38:16 John Anderson posted:
Hi DW people, I have a simple form that tries to write to MS SQL database.The table has many columns but I only want to write to 3:
frist name, last name, email.
So when I create the form and run, it complains I can't write a null to the User ID column - huh?
Who said anything about User ID? Remeber my form is supposed to write to Fn , Ln , Email.
Why is it trying to do this? This is the auto numbering primary key and don't want to write there anyways? Ideas, way greatful, John A
Replies
Replied 21 Feb 2003 01:20:54
21 Feb 2003 01:20:54 Dennis van Galen replied:
have you set the identity in sql server id field, if not then you should.
sounds to me like you are inserting a record into three fields and there is a fourth in the table that will not allow nulls.
auto nr in sql is bit 4, no nulls, identity yes, seed 1.
HTH
with regards,
Dennis van Galen
Webmaster KPN Telecom Holland
Financial & Information Services
Studio MX / CFMX PRO / SQL 2000 / NT4 AND win2kPRO / IIS5
sounds to me like you are inserting a record into three fields and there is a fourth in the table that will not allow nulls.
auto nr in sql is bit 4, no nulls, identity yes, seed 1.
HTH
with regards,
Dennis van Galen
Webmaster KPN Telecom Holland
Financial & Information Services
Studio MX / CFMX PRO / SQL 2000 / NT4 AND win2kPRO / IIS5
Replied 21 Feb 2003 10:13:41
21 Feb 2003 10:13:41 Iain Stewart replied:
Hi,
I've had the same problem, but it was because i hadn't made the field auto increment, so check to make sure that is the case in db
Iain
head hurts, 'mental note to self, stop banging head !'
I've had the same problem, but it was because i hadn't made the field auto increment, so check to make sure that is the case in db
Iain
head hurts, 'mental note to self, stop banging head !'
Replied 21 Feb 2003 15:01:47
21 Feb 2003 15:01:47 John Anderson replied:
Thanks, people! I think I will get around this now. Not a DW code problem, but the way the database was set up. All these little things... should have been a dentist.