Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Database Field Output

Boosting Primary Keys by webmigit
Posted: 25 Mar 04

I recently created a sort of check drafting system in cold fusion.. but that's not important, what is important is the check numbers.

When you get a new account from the bank, they ask you what check # to start out at.. Nobody wants to start at 1.. Businesses distrust low-numbered checks.

I had the same feeling about my check drafting system, after all the numbers are only for your identification purposes anyway.. they're not anything super special.

Well there is of course just adding to the number in the output..

#Evaluate(chknum + 9300)#.. Now that's always nice but for consistency I'd have to do it everywhere, and then if osmeone entered a check number, I'd have to subtract the added amount.

Well.. Check numbers should be unique and of course databases have primary keys which are also instended (and thoroughly enforced) to be unique. So that's what I used.. But I didn't want to start at 1.. and I didn't want to have thousands of "fake" rows..

But I found out (this works in sql server at least) that if you setup another primary key on your table and change the original to regular int/numeric/number whatever, and then for your first row put in the desired starting number, and then go back and delete the new key and restore the properties to the old one.. That that's where the number starts.

This isn't a big tip.. Its not going to make or break a website, but it saved me a lot of time.

Tony Hicks

Back to Adobe FAQ Index
Back to Adobe Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close