sqlcmd.exe and MsBuild

Today I wrote my first MsBuild script that uses sqlcmd.exe to execute SQL Server commands remotely. It is awesome. Although it is fairly limited, for tasks like backing up databases, it is very simple and easy.

  <target name="Backup">
    <exec command="sqlcmd -S $(server) -q "$(sql)""></exec>
  </target>