title: Populating ms sql with sql files
body: <p>I already have an existing database I am trying to keep up to date on a daily basis. I get a daily dump of sql files. The batch script below created and populated the database the first time I run it, but that doesn't work when I try to update the database with it. </p>
  
  <pre><code>`@echo off
  ECHO %USERNAME% started the batch process at %TIME%  &gt;output.txt
  
  
  for %%f in (*.sql) do (
  sqlcmd.exe  -S servername -E   -d DatabaseName -i %%f &gt;&gt;output.txt
      )
  pause`
  </code></pre>
  
  <p>Is there a different command for updating a database with sql files?
  This is the output i get.</p>
  
  <pre><code>HUTRC started the batch process at 9:55:12.25 Changed database context to 'master'. Msg 15416, Level 16, State 1, Server HUTRC1-HP, Procedure sp_dbcmptlevel, Line 67 Usage: sp_dbcmptlevel [dbname [, compatibilitylevel]] Valid values of the database compatibility level are 100, 110, or 120.
  </code></pre>
  
  <p>What the sql file looks like. It is very long. I just got the first few lines.</p>
  
  <pre><code>USE [master]
  GO
  IF NOT EXISTS (SELECT [name] FROM sys.databases WHERE name = N'Migration')
  BEGIN
  CREATE DATABASE [Migration] COLLATE SQL_Latin1_General_CP1_CI_AS
  END
  GO
  EXEC dbo.sp_dbcmptlevel @dbname=N'Migration', @new_cmptlevel=90
  </code></pre>