CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Autoincrement keys, How To

Print topic Send  topic

Author Message
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
> >
> >
>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.