title: How to Increment NVarchar Value in While Loop Using TSQL?
body: <p>I am trying to increment nvarchar value of a variable like this;</p>
  
  <pre><code>    declare @i int
      set @i = 0
      -- I want a book `@BookSerialNo`  to be increment like e.g abcde-1, abcde-2 
      set @BookSerialNo = CAST(@BookSerialNo +'-' + @i as nvarchar(50));
      WHILE(@i&lt;&gt;@Quantity)
          BEGIN
              INSERT INTO Library.BookDetail
              (
                  BookId,
                  BookSerialNo,
                  CreatedBy,
                  CreateDate,
                  UpdateDate,
                  Updateby
              )
              VALUES
              (
                  @BookId,
                  @BookSerialNo,
                  @CreatedBy,
                  @CreatedDate,
                  @UpdatedDate,
                  @UpdatedBy
              )
              SET @i = @i+1;
          END
  </code></pre>
  
  <p>So, My question is, <br />
  <strong>How to Increment the value of <code>@BookSerialNo</code> eache time int the loop?</strong>
  <br />
  I want it like e.g 'abcdef-1', 'abcdef-2', 'abcdef-3', I just want to include the numbers after the '-'.</p>