simple query cannot be killed

  • Hi Guys,

    For some reason the following query takes 100% CPU of one Core. I cannot kill it.. any one has a clue why ?

    SELECT

    CASE WHEN '1' IN(SELECT '1') THEN '1 IN 1' ELSE '1 NOT IN 1' END,

    CASE WHEN '1' IN(SELECT NULL) THEN '1 IN NULL' ELSE '1 NOT IN NULL' END

  • put the SPID in the following code to see if it takes 100% of one of your cores, and please post your results

    declare @Time datetime2(7)

    declare @CPU66 bigint

    declare @SPID int

    set @SPID=

    select @CPU66 = max(case when spid=@SPID then cpu end),

    @Time=cast(CURRENT_TIMESTAMP as datetime2(7)) from master..sysprocesses where spid = @SPID

    waitfor delay '00:01:00.000'

    select

    (max(case when spid=@SPIDthen cpu end)-@CPU66+0.0)/(datediff(millisecond,@Time,cast(CURRENT_TIMESTAMP as datetime2(7)))+0.0) as SPID66 from master..sysprocesses where spid = @SPID

Viewing 2 posts - 1 through 1 (of 1 total)

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