title: Update a table with the result of a store procedure actions over a column from the table
body: <p>I have a table name resultado, that is created by calling and executing another stored procedures or functions. As a result a have a column that contains '1' and '0' as a vector like this '111100001'. Also I have a store procedured that count the numbers of 1 in the 'vector' as it follows. </p>
  
  <pre><code>ALTER PROC [dbo].[CharCount](@String VARCHAR(4000),@caracter VARCHAR(2))
  AS
  BEGIN
  DECLARE @long INT
  DECLARE @numeroveces INT =0
  DECLARE @consecutivo INT =0
  DECLARE @consecutivo1 INT =0
  SET @numeroveces=0
  SET @long=LEN(@String)
  
  WHILE @long&gt;=0
  BEGIN
  IF @caracter=SUBSTRING(@String,@long,1)
  BEGIN
              set @numeroveces = @numeroveces + 1
              set @consecutivo = @consecutivo + 1
  END
  IF @caracter&lt;&gt;SUBSTRING(@String,@long,1) or (@long = 0)
  BEGIN
      IF @consecutivo &gt; @consecutivo1
          BEGIN
              set @consecutivo1 = @consecutivo
          END
    set @consecutivo = 0
  END
  SET @long=@long-1
  END
  SELECT @numeroveces
  SELECT @consecutivo1
  END
  </code></pre>
  
  <p>What I need is to execute the store procedure over a column from my table resultado and update the column with the result of the SP. </p>
  
  <p>OriginalColumn--->SPResult---->UpdatedColumn</p>
  
  <p>110111     --->         5    ---->        5</p>