 <blockquote> <p>Keep it simple</p> </blockquote> <pre><code>-- Your original declaration declare @myVariable nvarchar(max) set @myVariable = 'Select ROWGUID from MySampleTable' -- Additional code declare @myQuery nvarchar(max) = 'SELECT ROWGUID FROM myTable WHERE ROWGUID in (' + @myVariable + ')' exec (@myQuery) </code></pre>