• The problem is that you don't have any parameters declared. All you have are variables.

    Without knowing more about your SP, this might help but you might want to remove parameters that should actually be variables (like @oldstatus).

    Create PROCEDURE [dbo].[sp_MailUpdateEvents]

    (

    @EventId int,

    @EventName nvarchar(500),

    @EventDate datetime,

    @sstatus nvarchar(50)

    )

    AS

    SET nocount ON

    BEGIN TRY

    declare @oldstatus nvarchar(50),

    @newstatus nvarchar(50)

    select @oldstatus=sstatus from tblEvents where EventID=@Eventid

    --create TABLE #StatusChanges ( Status1 Varchar(20),Status2 VARCHAR(20));

    UPDATE [tblEvents]

    SET [EventName] = @EventName, [EventDate] = @EventDate,

    [sstatus]= @sstatus, [Updateuser]=@Updateuser,UpdateDate=GetDate()

    WHERE [EventID] = @Eventid

    select @newstatus=sstatus from tblEvents where EventID=@eventid

    --if oldstatus doesnot matches with newstatus then execute rest

    if @oldstatus <> @newstatus

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2