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.

Pradip PandeyPosted Jul 9, 2014, 2:06 AM
Use below code
Hope it will help you.
Khan Abrar AhmedPosted Jul 9, 2014, 1:35 AM
DECLARE @value VARCHAR(64)='BC10';
DECLARE @addvalue INT;
SELECT @addvalue=(CAST(REPLACE(@value,'BC','') AS INT))+1;
SELECT @addvalue