Hi Paul:

 

There are a few functional ways you could do this; however, for the sake
of simplicity and quick implementation, I would consider using an
IDENTITY column with an INT or NUMERIC data type.  That will function
just like the auto num column for primary keys in an Access database.

 

You could also implement a trigger that will increment the number in the
specified column in the event of an insert and decrement it in the event
of a deletion.

 

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Morton
Sent: Wednesday, March 12, 2008 12:46 PM
To: [email protected]
Subject: [ACFUG Discuss] Database incremental Counter

 

I'm just looking for ideas when creating a counter in a SQL server
database.

I have a need for a counter that stores an integer value and increments
the counter each time it is used.

My inclination is to create a table with one record with one integer
field that is just retrieved, incremented, and updated each time I need
a new number.  

It seems sort of kludgey, and I would love to hear any other
implementations anyone may have used, or can dream up.  Also, if anyone
can anticipate any issues with this method, I would love to hear them.

 

I have no need for keeping any records of the numbers used.

 

Paul Morton

 


------------------------------------------------------------- 
Annual Sponsor - Figleaf Software <http://www.figleaf.com>  

To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform 

For more info, see http://www.acfug.org/mailinglists 
Archive @ http://www.mail-archive.com/discussion%40acfug.org/ 
List hosted by FusionLink <http://www.fusionlink.com>  
-------------------------------------------------------------



-------------------------------------------------------------

Annual Sponsor FigLeaf Software - http://www.figleaf.com



To unsubscribe from this list, manage your profile @ 

http://www.acfug.org?fa=login.edituserform



For more info, see http://www.acfug.org/mailinglists

Archive @ http://www.mail-archive.com/discussion%40acfug.org/

List hosted by http://www.fusionlink.com

-------------------------------------------------------------


Reply via email to