How to set value to declared variable in SQL Server
<p>How to set value to declared variable in SQL Server.</p>

<pre><code>DECLARE  @V_SEQUENCE INT,  @V_SEQUENCENAME NVARCHAR(MAX);
SET @V_SEQUENCENAME = 'dbo.MYSEQ';   
EXEC('SELECT @V_SEQUENCE = NEXT VALUE FOR  ' + @V_SEQUENCENAME)
SELECT @V_SEQUENCE
</code></pre>

<p>Here i am getting an error:</p>

<blockquote>
  <p>Must declare the scalar variable "@V_SEQUENCE"' </p>
</blockquote>

<p>Please tell me how to get result of <code>@V_SEQUENCE</code>.</p>