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

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to