无效的对象名称'数据库'存储的程序

时间:2015-12-10 11:04:08

标签: sql-server stored-procedures sql-server-2012

我正在尝试执行[dbo].[USERINFORMATION]存储过程。

它成功执行程序,但显示红色波浪线并且:

  

无效的对象名称' [dbo]。[USERINFORMATION]'

鼠标悬停。我使用的是Microsoft SQL Server 2012 Management Studio [版本11.0.2100.60]。

图片

Error Information

代码:

USE [AdventureWorks2012]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*
    EXEC [DBO].[USERINFORMATION] @middleName=''
*/
ALTER PROCEDURE [DBO].[USERINFORMATION]
    (@MiddleName nvarchar(50))
AS 
    SET NOCOUNT ON
    SET @MiddleName = ISNULL(@MiddleName, '')

    SELECT 
        FirstName, MiddleName, LastName
    FROM 
        HumanResources.vEmployeeDepartmentHistory
    WHERE 
        ISNULL(MiddleName,'') = @MiddleName;

1 个答案:

答案 0 :(得分:3)

尝试刷新intellisense:

Edit - IntelliSense - Refresh Local Cache

Ctrl + Shift + R