title: Running SQL script as part of visual studio 2010 Setup Project
body: <p>Good day,</p>
  
  <p>My goal is to create a msi for a windows service and during installation various sql scripts must run.</p>
  
  <p>What I want to do is create a msi that, when the user runs it, it installs the service on the pc and runs 3 .sql scripts, one for creating the database, one for population, and one to add a stored procedure.</p>
  
  <p>I am able to add create a setup project for the service using <a href="https://msdn.microsoft.com/en-us/library/zt39148a(v=vs.100).aspx" rel="nofollow">the msdn overview</a></p>
  
  <p>My problem is that I have no idea how to run a sql script during the install (and how to specify the sql connection)</p>
  
  <p>Is there any way to do this in visual studio, or will I need to resort to batch files/purchasing InstallShield?</p>
  
  <p>Any help is appreciated,<br>
  Regards<br>
  Jeff</p>
  
  <p><strong>EDIT</strong>: I am using visual studio 2010 Professional and SQLServer 2012</p>