Auto-Incrementing 
Author Message
 Auto-Incrementing

Would someone please tell me how to, or send me an example
of, the way to auto-increment a primary key field in a
table. I know I have to use a UDF but I am not certain
where to implement the UDF.

Thank you.



Wed, 14 Jan 2004 00:09:24 GMT  
 Auto-Incrementing
Hello,

Take a look at the NewID stored procedure in the Tastrade sample database.

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts

Quote:

> Would someone please tell me how to, or send me an example
> of, the way to auto-increment a primary key field in a
> table. I know I have to use a UDF but I am not certain
> where to implement the UDF.

> Thank you.



Wed, 14 Jan 2004 00:58:04 GMT  
 Auto-Incrementing
Jerry,

Pay special attention to how you carry out your auto-increment function.
Lots of people here just query the main table directly to get the largest
number and then use that number + 1.

We know you're wise enough to use a Keys table and to lock that table or
record while retrieving the key and saving the next value (as in TasTrade).
I just thought I'd include this for others who may be reading.

There's a nice article on Craig Berntson's website about Primary Keys:
http://www.craigberntson.com/articles.htm

--

Cindy Winegarden  MCSD, Microsoft MVP


Quote:
> Would someone please tell me how to, or send me an example
> of, the way to auto-increment a primary key field in a
> table. I know I have to use a UDF but I am not certain
> where to implement the UDF.

> Thank you.



Wed, 14 Jan 2004 20:35:08 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Auto Increment Field

2. Auto Increment

3. Auto-incrementing a primary key field

4. Auto Increment Field

5. Auto Incrementing Primary Key

6. Auto Increment Field

7. Auto-Incremented field

8. Auto-increment Field in Foxpro

9. How to make an auto-incrementing index

10. auto-incrementing a primary key

11. auto increment a field

12. VFP5 and "auto increment"

 

 
Powered by phpBB® Forum Software