Hi,
I have one transaction table. in that one OrderId column is there. for that column assign one default value like 'BC10'. I need to increment that OrderId value for every transaction. how can i write query for that or is there any possibility to increment that column value from aspx page. if anyone knows pleae help me......
Example: i have done first transaction, that OrderId is BC10. For next transaction OrderId is BC11.


Khan Abrar AhmedRank #778 · 3K reputationPosted Jul 8, 2014, 9:35 PM EDT
DECLARE @value VARCHAR(64)='BC10';
DECLARE @addvalue INT;
SELECT @addvalue=(CAST(REPLACE(@value,'BC','') AS INT))+1;
SELECT @addvalue
Pradip PandeyRank #452 · 5.6K reputationPosted Jul 8, 2014, 10:06 PM EDT
Use below code
Hope it will help you.