title: Inserting Increment Values into Table Pt 2
body: <p>I wrote the following script to insert values into a table.
  I am receiving an error message when trying to insert value for one of the columns called column A
  Cannot insert the value NULL into column 'A', table 'TEST_VALIDATION.dbo.TableA'; column does not allow nulls. INSERT fails.</p>
  
  <p>I have tried declaring a variable for this value being declared. The value I am having problems with is the @insertswid invarchar(100) Variable
  It should be incrementing the name Spinweb + 1 for each line. Example first row column A should equal Spinweb1, row 2 Spinweb 2 and so on.</p>
  
  <pre><code>   Declare @count int = 1
     Declare @lot nvarchar = 'StressTestAuto'
     Declare @lotno nvarchar(10) = 1
     Declare @insertlot nvarchar(100)
     Declare @spinwebid nvarchar = 'SpinWeb'
     Declare @webid nvarchar(10) = 1
     Declare @insertswid nvarchar(100)
     While @count&lt;= 100   
  Begin
      set @insertlot = @lot + @lotno
      set @insertlot = @spinwebid + @webid
      Insert into CREATE_PRDO_EWS (SpinwebABI , SAPPONo, 
      ItemCodeFinish, PlannedQty, WhseFinish, ItemCodeStart, StartQty, 
      WhseStart, ParentLotNo) values (Cast(@insertswid as nvarchar(100)), 0, 
      'Lynx', 
      430, 'E_CHD', 'WA00N44A', 1, 'E_CHD', Cast(@insertlot as 
      nvarchar(100)))
      Set @count = @count + 1
      Set @lotno = @lotno + 1
      Set @webid = @webid + 1
  End
  </code></pre>