Wednesday, July 23, 2014

hide a DIV when the user clicks outside of it

hide a DIV when the user clicks outside of it
 
$(document).mouseup(function (e)
{
    var container = $("YOUR CONTAINER SELECTOR");

    if (!container.is(e.target) // if the target of the click isn't the container...
        && container.has(e.target).length === 0) // ... nor a descendant of 
//the container
    {
        container.hide();
    }
});
 
The magic is the not using click. 

Saturday, July 12, 2014

Stop SQL job from commands

Jobs are not stopping when click on stop button of job. so I used follwing command to stop it.



SELECT j.name as jobname
   
              , j.*,ja.*
FROM msdb.dbo.sysjobactivity ja
JOIN msdb.dbo.sysjobs j
    ON ja.job_id = j.job_id
WHERE ja.session_id = (SELECT TOP 1 session_id FROM msdb.dbo.syssessions ORDER BY agent_start_date DESC)
AND start_execution_date is not null
AND stop_execution_date is null;

Step 2-> Copy all rows in Excel.

Step 3-> look the DB name, Job execution time, Job started date etc.

Step 4-> Now select correct SPID and stop it.

USE msdb ; GO EXEC dbo.sp_stop_job N'Job Name' ; GO


--sp_who2
--kill -58-  

Where 58 Is SPID which I want to stop.