title: Can EXEC master..xp_cmdshell be used on a set of data?
body: <p>I have a single windows shell command I'd like to run (via EXEC master..xp_cmdshell) once for each row in a table.  I'm using information from various fields to build the command output.</p>
  
  <p>I'm relativity new to writing T-SQL programs (as opposed to individual queries) and can't quite get my head around the syntax for this, or if it's even possible/recommended.  </p>
  
  <p>I tried creating a single column table variable, and then populating each row with the command  I want to run.  I'm stifled at how to iterate over this table variable and actually run the commands. Googling around has proven unhelpful.</p>
  
  <p>Thanks in advance for any help!</p>