Ask a Question related to Coldfusion Database Access, Design and Development.
-
surfinjay #1
how to have sql server generating primary keys oninsertion of record set
Hi everyone,
I need some help here. I am building a website for a company, which requires
customerregistration, buying products and so on. My question now is the
following:
I have created all the databases I need on my SQL Server 2005 and have
connected coldfusion to it successfully. I can read in records via the
coldfusion insert record wizard. But I was hoping sql server to assign my
primary keys automatically since i have put them on Identity and configured the
seeds and so on. But everytime i try to read in the records on the site it
tells me my primary keys cant be null. So does coldfusion now have to assign
the keys or can I have sql server create them (which i would prefer) somehow.
Id be real glad for some feedback
Thanks
Jay
surfinjay Guest
-
Autoincremented id with two primary keys
Hi all. I have this table: CREATE TABLE sites_pages ( id int(6) NOT NULL, site_id int(4) NOT NULL, name varchar(80) NOT NULL, UNIQUE KEY... -
Preserving Primary Keys in DTS
I have a dev and production server. I want to copy the data from a table in production to DEV and preserve the primary key values. What's the best... -
Tablespaces and primary keys
Implicit indexes created by a constraint do not appear to honor the default tablespace. The index gets created in the "null" tablespace. I took... -
Deleting Primary Keys
Can describe how to drop a primary key from a table? Thanks, Don Bryant -
Primary Keys
How is it that even though I have the column "username" in my database set as a Primary key, using my PHP script to add new users to the database... -
SQLMenace #2
Re: how to have sql server generating primary keys oninsertion of record set
Make the field an identity column
[url]http://sqlservercode.blogspot.com/[/url]
SQLMenace Guest
-
surfinjay #3
Re: how to have sql server generating primary keys oninsertion of record set
well as i said all my primary keys in sql server ARE set to integers, identity
true,seed 1 and increment 1.
yet if i try to read in data, of course im not reading in the keys. it tells
me:
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]DEFAULT or NULL are not allowed
as explicit identity values.
So therefore i suppose that sql server did not give them values when i thought
it was supposed to.
surfinjay Guest
-
SQLMenace #4
Re: how to have sql server generating primary keys oninsertion of record set
how many columns in the table and how many are you passing in?
you have to pass in 1 less than the sum of all the columns
Make sure you don't have an extra comma somewhere
SQLMenace Guest
-
surfinjay #5
Re: how to have sql server generating primary keys oninsertion of record set
Hi
well i tried this example:
i have a table called productinfo with the columns: productnr, prodctname,
version, build and desscription.
when creating an insertion form with the coldfucsion insertion wizard i take
out the productnr of the listed columns when having to select which columns i
want to create frms for, because of course i dont wnat the key to be read in.
Therefore i have 5 columns and i am reading in 4 coliumns, ust like you said.
Still im getting the same error ?!?!
surfinjay Guest
-
surfinjay #6
Re: how to have sql server generating primary keys oninsertion of record set
i got the probem!
Dreamweaver did not update the query where as i had already changed the form.
SO now i got it all roight.
thx anyway
Jay
surfinjay Guest



Reply With Quote

