title: To compare column name with the corresponding values in Microsoft SQL Server
body: <p>I have a function which takes two parameter type and value. According to the type it will search the corresponding table whether the value exist or not and return a boolean value. Now I have created a table with the type as columns. I want to pass the column name and its corresponding values to be passed to the function.</p>
  
  <p>For example</p>
  
  <pre><code>manager employee
  ======= =========
  leo      john
  
  lia      joesph
  </code></pre>
  
  <p>this is the table with column name manager and employee and their corresponding values.
   I need to get like </p>
  
  <pre><code>function validate(columnname1,columnvaue1),
  function validate(columnname1,columnvaue2),
  function validate(columnname2,columnvaue1),
  function validate(columnname2,columnvaue2)
  </code></pre>
  
  <p>Can you please suggest me a solution....</p>