Nirmal KumarC

Nirmal KumarC

  • 1.4k
  • 327
  • 79.1k

How to dynamic increment Batch ID in sql server with cursor

Sep 18 2014 10:28 AM

   I want How to weekly wise one time all batches as Batch id dynamic increment  using Sql server with cursor example below.

Batches  Example:

Batches:
PSF/180              
ERS/B366            
ARPA/B146          
EFA/B989            
PSSR/B1096          
RECP/B175          
CHEMCO/B73          
ERS/B367            

So this All Batch id Dynamically get this result in below


I want ARPA/B146  get data to database

After Split the ARPA/B   separate 146 

146 Value Dynamic Increment 147

after this value ARPA/B147  insert Batchid  to database this result 

another one Example: PSSR/B1096
this id dynamically create PSSR/B1097


Thanks






Answers (2)