title: How do I assign multiple values to a variable of the same column in sql server
body: <p>How do I assign multiple values of the same column in a variable so that I can use the independent values in the programming. Is there any concept of an array in SQL server?</p>
  
  <pre><code>SELECT @x= Code FROM Security WHERE Department=@dpt;
  </code></pre>
  
  <p>This works correctly when code has single value, but when code has multiple values it provides errors.</p>