消息156,级别15,状态1,过程CUSTOMER_IMPORT,第33行关键字' FROM'

时间:2016-06-23 20:18:34

标签: sql-server sql-server-2014

CREATE PROCEDURE CUSTOMER
    @LastName nvarchar(50) = NULL, 
    @FirstName nvarchar(50) = NULL
AS
BEGIN
    SET NOCOUNT ON;

    SELECT @LastName, @FirstName, 
    FROM CUSTOMER
    WHERE FirstName = @FirstName AND LastName = @LastName
END
GO

1 个答案:

答案 0 :(得分:0)

是逗号!

试试这个:

CREATE PROCEDURE CUSTOMER
    @LastName nvarchar(50) = NULL, 
    @FirstName nvarchar(50) = NULL
AS
BEGIN
    SET NOCOUNT ON;

    SELECT @LastName, @FirstName
    FROM CUSTOMER
    WHERE FirstName = @FirstName AND LastName = @LastName
END
GO