Based on the code you provided, value for
@DoNo
variable should be different on each call.
For seeing the sequence behaviour you can use PRINT statement to show the content of you variable, like:
Declare @DoNo varchar(10)
SET @DoNo = next value for DoNo
PRINT @DoNo
set @DoNo = 'DO-' + right('000000'+convert(varchar,@DoNo),6)
PRINT @DoNo
As a side note, I would suggest storing the value from the sequence as-is. If you need to format it when displayed, either do the formatting in SELECT statements or use a computed column.
EDIT:
If the select used in the insert return several rows then the same value from the variable is used for all of the rows. Because of this the value need to be generated on row basis.
So try modifying the procedure as follows
ALTER Procedure [dbo].[W_usp_SO_GENERATION]
@SoNo nvarchar(20),
@SoDate datetime,
@STDB nvarchar(5),
@Products nvarchar(50),
@issueNo nvarchar(10),
@User nvarchar(20),
@terminal nvarchar(50)
AS
BEGIN
INSERT INTO [dbo].[SOMaster_TEMP]
(SoNo, SODate, SVCode, SVName, MVCode, DistCode,
RouteCode,Area,Edition, SeqNo,Qty,Rate, STDB, BSTD, BEND, BLOS,
Products, IssueNo, CreatedBy, CreatedOn, Terminal, DONo,GSTP,Type)
SELECT @sono, @SoDate, SVCode, SVName, MVCode, DistCode, RouteCode,
Area, Edition, SeqNo, '0', Rate, @STDB, '0', '0', '1',
@Products, @issueNo, @User, @SoDate, @terminal,
'DO-' + right('000000'+convert(varchar,(next value for DoNo)),6),
'6', type
FROM [dbo].[vwRDMS]