我正在尝试在 SQL Server 2008 上创建存储过程,但出现错误:
消息 156,级别 15,状态 1,过程 usp_UpdateDistribiutionList,第 12 行关键字“AS”附近的语法不正确。
你能建议吗?
存储过程代码:
USE LogDB
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE usp_UpdateDistribiutionList
-- Add the parameters for the stored procedure here
@distId INT,
@DistEmails varchar(max)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
UPDATE [NotificationDistribution] AS dist
SET dist.emailCC = @DistEmails
WHERE dist.DistributionID = @distId
END
第二个问题:
是否可以使用参数来获取像 dist.@columnName 这样的列名?