Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Sequential Numbering

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-02 : 07:38:09
Rick writes "I use a table to store purchase requisitions in. The table contains a field named job_number and a field named po_req_num. There are multiple job numbers in this table. What I am trying to figure out how to do is to automatically number each po requistion number starting at 1, but for each job number. We use the job number + the po requisistion number for the actual purchase requisistion number. It makes it easier for my users if they have a sequential number start at 1 for each job number.
I am using sql 2000 and Windows 2000 service pack 3

Thank you"

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2003-07-02 : 09:20:33
Typically this sort of issue is addressed through the use of a trigger. If you're not familiar with them, post the relevant DDL (the CREATE TABLE statements) and we can write a sample trigger.

Jonathan
{0}
Go to Top of Page
   

- Advertisement -