Yeah, I find that importing is HORRIBLE for everything but actual data
values. When I move data over, I like to create the tables via MS SQL
Servers "General SQL Scripts" options (No, I don't write my own scripts),
making sure to select options for default values and keys. Then once the
tables exists, I import the data.

.......................
Ben Nadel 
www.bennadel.com

-----Original Message-----
From: Orlini, Robert [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 18, 2006 12:38 PM
To: CF-Talk
Subject: RE: Insert fails?

Thanks Ben. Its fixed. The table was imported to another server and it did
not save the ID field as primary/identity YES. It was set to NO. I reset and
it worked. But its shows not to assume the import will copy everything
exactly.

Robert O.

 -----Original Message-----
From:   Ben Nadel [mailto:[EMAIL PROTECTED] 
Sent:   Tuesday, July 18, 2006 12:24 PM
To:     CF-Talk
Subject:        RE: Insert fails?

Is it marked as the Primary Key...  Try marking it as the primary key of the
table as well. 

.........................
Ben Nadel
www.bennadel.com

-----Original Message-----
From: Orlini, Robert [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 18, 2006 12:04 PM
To: CF-Talk
Subject: Insert fails?

When I insert info into my dbase I get an insert fails error. See below. 

Cannot insert the value NULL into column 'ID', table
'pc_inventory.dbo.inventory'; column does not allow nulls. INSERT fails.

The ID filed is setup as an Identity field in SQL.

Any ideas please? Seems simple, but I'm stuck in neutral here. Thanks.

Insert code is:

<CFQUERY name="inventory" datasource="pc_inventory"> INSERT INTO inventory (
department, floor, lname, fname, pcname, phone, password, pcmodel,
workgroup, ip, printerip, printer, serialnumber, port, switchport,
oldpcnumber, newpcnumber,
comments)

VALUES (
'#FORM.department#',
'#FORM.floor#',
'#FORM.lname#',
'#FORM.fname#',
'#FORM.pcname#',
'#FORM.phone#',
'#FORM.password#',
'#FORM.pcmodel#',
'#FORM.workgroup#',
'#trim(FORM.ip)#',
'#FORM.printerip#',
'#FORM.printer#',
'#trim(FORM.serialnumber)#',
'#FORM.port#',
'#FORM.switchport#',
'#trim(FORM.oldpcnumber)#',
'#trim(FORM.newpcnumber)#',
'#FORM.comments#')
</CFQUERY>








~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246915
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to