Steve
|
Posted: 05/17/2002, 10:34 AM |
|
Cold Fusion User
Sql Server DB
I am trying to Auto Increment my primary key when user insert a new record.
How do I go about doing this?
I have attempted to use the BEFORE INSERT event the way CC shows in the help
screen but I am still getting an error of cannot place nulls in the key
thanks
|
|
|
Barry G. Sumpter
|
Posted: 05/17/2002, 1:29 PM |
|
Hi Steve,
Its done on SQL Server.
Set the column name to xxxID
Set the Datatype to int
Set Identity to Yes
Identity to Seed
Identity Increment to 1
However, I do have a homegrown SQL Serve db here
that seems to work properly via CodeCharge 2.
Column Name is ProductID
Data Type is Uniqueidentifier
Default Value is (newid())
Is RowGuid is Yes
Thanks,
Baz
"Steve" <groningasc@navair.navy.mil> wrote in message
news:ac3evs$nfj$1@news.codecharge.com...
> Cold Fusion User
> Sql Server DB
>
> I am trying to Auto Increment my primary key when user insert a new
record.
> How do I go about doing this?
>
> I have attempted to use the BEFORE INSERT event the way CC shows in the
help
> screen but I am still getting an error of cannot place nulls in the key
>
> thanks
>
>
|
|
|
Barry G. Sumpter
|
Posted: 05/17/2002, 1:32 PM |
|
Feel free to retrieve the value in script.
I suggest NOT attempting to set or change the primary key in this manner.
Let Sql Server take care of it for you.
And let CC use it if and when the wizards want.
baz
"Steve" <groningasc@navair.navy.mil> wrote in message
news:ac3evs$nfj$1@news.codecharge.com...
> Cold Fusion User
> Sql Server DB
>
> I am trying to Auto Increment my primary key when user insert a new
record.
> How do I go about doing this?
>
> I have attempted to use the BEFORE INSERT event the way CC shows in the
help
> screen but I am still getting an error of cannot place nulls in the key
>
> thanks
>
>
|
|
|
Steve
|
Posted: 05/20/2002, 5:56 AM |
|
Thanks That worked!! letting SQL SERVER do the dirty work
"Barry G. Sumpter" <bsumpter@bigpond.net.au> wrote in message
news:ac3pdn$chm$1@news.codecharge.com...
> Feel free to retrieve the value in script.
>
> I suggest NOT attempting to set or change the primary key in this manner.
>
> Let Sql Server take care of it for you.
>
> And let CC use it if and when the wizards want.
>
> baz
>
> "Steve" <groningasc@navair.navy.mil> wrote in message
>news:ac3evs$nfj$1@news.codecharge.com...
> > Cold Fusion User
> > Sql Server DB
> >
> > I am trying to Auto Increment my primary key when user insert a new
> record.
> > How do I go about doing this?
> >
> > I have attempted to use the BEFORE INSERT event the way CC shows in the
> help
> > screen but I am still getting an error of cannot place nulls in the key
> >
> > thanks
> >
> >
>
>
>
|
|
|