How to split String value in sqlserver;
Example :
I want BE/CSE01 this is string
After Split the BE/CSE separate 01
01 Value Dynamic Increment 02
after this value add BE/CSE02
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Sep 19, 2014, 1:20 AM
I think your last question is same as
http://www.c-sharpcorner.com/Forums/Thread/269145/how-to-dynamic-increment-batch-id-in-sql-server-with-cur.aspx
Nirmal KumarCPosted Sep 18, 2014, 8:45 AM
Your Source is very useful but i want more batches Dynamically Created.
Batches:
PSF/180
This is Batch for my database your source is only particular length only change dynamic Batch Id,But i want my side diff batchid available
ex:PSF/B180 ,ARPA/B146 ,RECP/B175 and CHEMCO/B73
this id also totally different. so how to get selected batchid wise incremennt value.
I want This below Result Batch wise select dynamically increment.
Example:
PSF/B1081 , ARPA/B146,RECP/B176, CHEMCO/B74
Thanks
Jignesh TrivediPosted Sep 18, 2014, 7:44 AM
hi,
very long but try....
select 'BE/CSE' + RIGHT('0000' + CAST(Cast(substring('BE/CSE01',7, LEN('BE/CSE01') - 5) as int) + 1 as varchar(10)),2)
also read my article
http://www.c-sharpcorner.com/UploadFile/ff2f08/auto-incremented-column-with-varchar-and-nvarchar-data-type/
hope this will help you.
Piyush PansuriyaPosted Sep 18, 2014, 5:09 AM
this is the solution I have :