Add a Sequence Number for a Table/Row

I have a file structure that I need to add things to and it is as follows:
TABLENAME
PROV_TB
ADDR_TB
ADDR_TB
AFFL_TB
TAX_TB
ETAX_TB
EPAY_TB
PROV_TB
I need to know how to create a sequence number the tables in between the PROV_TB. The PROV_TB has been assigned a number I created (153365000 is the 1st, 153365001 is the second) and now I need to add a sequence number for each table. So ADDR_TB is 1, ADDR_TB is 2, AFFL_TB is 3, TAX_TB is 4, ETAX_TB is 5, EPAY_TB is 6. The sequence numbers are specific to each provider so the number will restart for the second PROV_TB. So if the same tables populated under the second PROV_TB, the sequence would restart at 1. Any help would be great!

Questions by sdeuces90

Showing Answers 1 - 2 of 2 Answers

venkat

  • Mar 28th, 2016
 

syntax is:
@INROWNUM * @NUMPARTITIONS + @PARTITIONNUM
or
Surrogatekey()

  Was this answer useful?  Yes

Ram

  • Mar 30th, 2016
 

Venkat@ How you will get seq 1 with algorithm for 2 partitions and seq 1,2 for 3 partitions
@INROWNUM * @NUMPARTITIONS + @PARTITIONNUM
can you please explain...?

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions