Automate Microsoft SQL Server query runs
<p>I'm using a Microsoft SQL Server. What I am trying to do is automate the query runs. </p>

<p>I have a <code>.sql</code> file with queries in it, which returns a set of data. </p>

<p>I just have to change one line in the <code>.sql</code> file and execute it over like 100 times, but I realize that this is very repetitive.</p>

<p>Also, every time I run it, I need to export the data into an Excel file.</p>

<p>So, at the end of this process, I need to get 100 Excel files. </p>

<p>Is there a way to go around doing this? </p>