title: Execute the value of a varchar returned from a "OUTPUT DELETED.[ColumnName]" statement
body: <p>I am trying to use a table as a <a href="http://rusanu.com/2010/03/26/using-tables-as-queues/" rel="nofollow">heap queue</a>. However I am having a little trouble figuring out how to take the text that is generated in the dequeue function and perform a execute on it.</p>
  
  <p>Here is the table storing the queue and the dequeue method.</p>
  
  <pre><code>CREATE TABLE [dbo].[Merge_Queued_Work](Sql_Text varchar(2000) NOT NULL)
  GO
  
  create procedure usp_dequeueWork
  as
    set nocount on;
    delete top(1) from [Merge_Queued_Work] with (rowlock, readpast)
        output deleted.[Sql_Text];      
  go
  </code></pre>
  
  <p>How do I get the varchar from <code>deleted.[Sql_Text]</code> to a <code>execute</code> statement?</p>