SQLServer:未将对象引用设置为对象的实例

时间:2018-04-02 18:52:41

标签: sql sql-server tsql

以下是我收到的错误的屏幕截图。

img

以下是我想要运行的代码片段

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

我不确定导致这种情况的原因是什么?如果有任何其他信息我可以提供帮助,请告诉我。

===================================

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)

1 个答案:

答案 0 :(得分:0)

This thread表明该问题与.NET Framework更新KB4055532有关。尝试建议here的解决方法。