Hey everyone -

I am trying to create a event from within a stored procedure.



create procedure dba.procPurgeSamples
begin
-- if ((select count(1) FROM sysevent where event_name = 'PurgeSamplesEvent') >= 1) then drop event PurgeSamplesEvent end if
declare @d DATETIME
declare @x varchar(5)
select @d=(select dateadd(mi,1,getdate(*)))
select @x = cast(datepart(hh,@d) as varchar(2)) + ':' + cast(datepart(mi,@d) as varchar(2))
-- select 'Between ''' + @x + ''' AND ''' + @x + ''''

CREATE EVENT PurgeSamplesEvent
SCHEDULE PurgeSamplesEvent
Between ''' + @x + ''' AND ''' + @x + '''
HANDLER
BEGIN
execute procEventPurgeSamples
End


end;


Please advise on how this line is to be formatted...

Between ''' + @x + ''' AND ''' + @x + '''


thanks
tony