Hi,
  Can you paste the code you are using for Inserting??

Sudheer Chakka.

-----Original Message-----
From: Mike Kear [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 10:14 PM
To: CF-Talk
Subject: RE: CF Can't insertinto SQL2K ... any ideas? 


There IS NO primary key field in the insert statement.   That's what's
puzzling.  Instead of allocating a value for the keyfield, the database is
trying to insert a null in there.

I think the identity part of the database isn't working correctly.



-----Original Message-----
From: Chakka, Sudheer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 02, 2002 1:41 AM
To: CF-Talk
Subject: RE: CF Can't insertinto SQL2K ... any ideas?

Hi,
 Just take out the Primary key field from the Insert statement and rest
should be fine.

Sudheer Chakka.

-----Original Message-----
From: Christopher Olive [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 9:27 AM
To: CF-Talk
Subject: RE: CF Can't insertinto SQL2K ... any ideas?


you shouldn't be inserting into an IDENTITY key, really.  let the DB
generate the ID.

what's the SQL you're using?

christopher olive
cto, vp of web development, vp it security
atnet solutions, inc.
410.931.4092
http://www.atnetsolutions.com


-----Original Message-----
From: Mike Kear [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 30, 2002 11:07 AM
To: CF-Talk
Subject: CF Can't insertinto SQL2K ... any ideas?


My server's using CF5 and SQL2K.   I can insert into a table using the query
analyser, and I can have CF query the datasource no problem.  But when it
goes to insert into the database, using the same SQL I used in the query
analyser, it hiccups.  I get  a error messages as follows:

[quote]
ODBC Error Code = 23000 (Integrity constraint violation)
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL
into column 'memberid', table 'btcmsa.dbo.Newsletter'; column does not allow
nulls. INSERT fails.
The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (9:1) to (9:99).
 [/quote]

Here's the SQL I used to set up the table:

[quote]
CREATE TABLE [Newsletter] (
        [memberid] [int] IDENTITY (1, 1) NOT NULL ,
        [name] [varchar] (255) NULL ,
        [email] [varchar] (255) NULL ,
        [emailtype] [int] NULL ,
        [messagesentwhen] [datetime] NULL ,
        [messagesent] [bit] NOT NULL
) ON [PRIMARY]
GO
[/quote]


The field it's complaining about, "memberid" is a primary key.   The SQL in
the CFQUERY tag works fine in query analyser.  I have tried it with and
without username, password,  dbtype in the CFQUERY tag.


IS this the problem??


I'm thinking the problem is the SERVER doesn't have permissions to insert
into the database - it needs to be set up as database owner and hasn't been.
Which means I have to focus the SysAdmin's eye on it and that's not easy at
Easter time.   IS there anything else I should look for?  Something I might
have overlooked?


Cheers,
Mike Kear
Windsor, NSW, Australia
AFP WebWorks





______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to