Urgent Help Job failed

  • Incorrect syntax near '-'. [SQLSTATE 42000] (Error 102) Incorrect syntax near 'records'. [SQLSTATE 42000] (Error 102). The step failed.

    Here is the script

    --Script to delete the records from table in batches of 100 everynight

    SET NOCOUNT ON

    Declare @batchsize int

    Set @batchsize = 100

    while @batchsize > 0 and DATEPART(hour, GETDATE()) < 6

    begin

    delete top (@batchsize) from

    WebFramework.dbo.aspnet_WebEvent_Events

    set @batchsize = @@rowcount

    WAITFOR DELAY '00:00:00.250'

    end

  • Is there any other step in the job?

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • No there is no other step.

    I just took out the script and ran on server, its working fine .

    I really dont understand what the exact problem is.....

  • Please script out the job and paste the content here

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Its working fine now.

    Thanks for your help

  • Curious to know, what changed?

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply