title: Msg 156, Level 15, State 1, Line 16 Incorrect syntax near the keyword 'IF'
body: <pre><code>-- --------------------------------------------------------
  -- Host:                         192.168.62.245
  -- Server version:               Microsoft SQL Server 2014 - 12.0.2000.8
  -- Server OS:                    Windows NT 6.1 &lt;X64&gt; (Build 7601: ) (WOW64) (Hypervisor)
  -- HeidiSQL Version:             9.5.0.5196
  -- --------------------------------------------------------
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET NAMES  */;
  /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  
  
  -- Dumping database structure for mjDB
  CREATE DATABASE IF NOT EXISTS "mjDB";
  USE "mjDB";
  
  -- Dumping structure for table mjDB.PushNotificationLog
  CREATE TABLE IF NOT EXISTS "PushNotificationLog" (
      "pushNotificationLogId" INT(10,0) NOT NULL,
      "itemType" VARCHAR(20) NULL DEFAULT NULL,
      "itemId" INT(10,0) NULL DEFAULT NULL,
      "servicemanId" INT(10,0) NULL DEFAULT NULL,
      "title" VARCHAR(100) NULL DEFAULT NULL,
      "body" VARCHAR(4000) NULL DEFAULT NULL,
      "tranId" INT(10,0) NULL DEFAULT NULL,
      "createdBy" INT(10,0) NULL DEFAULT NULL,
      "createdDate" DATETIME(3) NULL DEFAULT NULL,
      PRIMARY KEY ("pushNotificationLogId")
  );
  </code></pre>
  
  <p>I exported this one from HeidiSQL updated to 19/12/2017, when I try to run this on SQL Server 2014 I get this error:</p>
  
  <blockquote>
    <p>Msg 156, Level 15, State 1, Line 16<br>
    Incorrect syntax near the keyword 'IF'. </p>
    
    <p>Msg 102, Level 15, State 1, Line 16<br>
    Incorrect syntax near 'mjDB'. </p>
    
    <p>Msg 911, Level 16, State 1, Line 17<br>
    Database 'mjDB' does not exist. Make sure that the name is entered correctly.</p>
  </blockquote>