Stored procedure is get error
I am trying to create a srored procedure on SQL Server 2008, I get an error:
Msg 156, Level 15, State 1, Procedure usp_UpdateDistribiutionList, Line 12
Incorrect syntax near the keyword 'AS'.
Can you advise?
Stored procedure code:
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
2nd question:
is it possible to use parameter to get column name like dist.@columnName?
thanks, Cfir.
No comments:
Post a Comment