Home Forums SQL Server 7,2000 T-SQL How to make a SP stop automaticaly after s.time? RE: How to make a SP stop automaticaly after s.time?

  • Sorry was talking crock before, why break a habit of a lifetime . The following works though.

    -------------------------------

    declare @startdate datetime,

    @enddate datetime,

    @count int

    set @startdate = getdate()

    set @enddate = dateadd(mi, n, @startdate) --where n is the minutes you want to time out after

    set @count = 1

    while @count > 0

    begin

    if getdate() >= @enddate

    break

    else

    set @count = @count + 1

    end

    print 'It worked'

    --------------------------------

    Hope it helps.

    Laters

    Ritch

    *I didn't do anything it just got complicated*

    Edited by - Ritch on 06/27/2003 04:41:24 AM


    "I didn't do anything it just got complicated" - M Edwards