title: SQLServer: Object reference not set to an instance of an object
body: <p>Here is a screenshot of the error I'm getting.</p>
  
  <p><img src="https://i.imgur.com/wTBLgWk.png" alt="img"></p>
  
  <p>Here is the snippet I am tying to run</p>
  
  <pre><code>USE [Warehouse_PCL]
  GO
  /****** Object:  Table [dbo].[RouteTable]    Script Date: 2/19/2018 2:27:57 PM ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TABLE [dbo].[RouteTable](
              [BranchID] [int] NOT NULL,
              [StoreID] [int] NOT NULL,
              [WaveGroup] [int] NOT NULL,
              [Wave] [int] NOT NULL,
              [Aisle] [int] NOT NULL,
              [Lane] [int] NOT NULL,
  CONSTRAINT [PK_RouteTable] PRIMARY KEY CLUSTERED 
  (
              [BranchID] ASC,
              [StoreID] ASC,
              [WaveGroup] ASC,
              [Wave] ASC,
              [Aisle] ASC
  )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  GO
  </code></pre>
  
  <p>I am unsure what is causing this, any thouhts? Let me know if there is any other information I can provide to help.</p>
  
  <pre><code>===================================
  
  Cannot execute script.
  
  ===================================
  
  Object reference not set to an instance of an object. (Microsoft.VisualStudio.Editor.Implementation)
  
  ------------------------------
  Program Location:
  
     at Microsoft.VisualStudio.Editor.Implementation.VsTextViewAdapter.SetScrollPosition(Int32 iBar, Int32 iFirstVisibleUnit)
     at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VSTextEditorTabPage.Clear()
     at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.DisplaySQLResultsControl.Clear()
     at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.DisplaySQLResultsControl.PrepareForExecution(Boolean prepareForParse)
     at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptAndResultsEditorControl.StandardPrepareBeforeExecute(QEStatusBarKnownStates newStatusBarState)
     at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.SqlScriptEditorControl.StandardPrepareBeforeExecute(QEStatusBarKnownStates newStatusBarState)
     at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptAndResultsEditorControl.OnExecScript(Object sender, EventArgs a)
  </code></pre>