File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2441,6 +2441,76 @@ BEGIN
24412441 )
24422442 ),
24432443 wait_time_hms =
2444+ /* the more wait time you rack up the less accurate this gets,
2445+ it's either that or erroring out*/
2446+ CASE
2447+ WHEN
2448+ SUM
2449+ (
2450+ CONVERT
2451+ (
2452+ bigint ,
2453+ dp .wait_time
2454+ )
2455+ )/ 1000 > 2147483647
2456+ THEN
2457+ CONVERT
2458+ (
2459+ nvarchar(30 ),
2460+ DATEADD
2461+ (
2462+ MINUTE,
2463+ (
2464+ (
2465+ SUM
2466+ (
2467+ CONVERT
2468+ (
2469+ bigint ,
2470+ dp .wait_time
2471+ )
2472+ )
2473+ )/
2474+ 60000
2475+ ),
2476+ 0
2477+ ),
2478+ 14
2479+ )
2480+ WHEN
2481+ SUM
2482+ (
2483+ CONVERT
2484+ (
2485+ bigint ,
2486+ dp .wait_time
2487+ )
2488+ ) BETWEEN 2147483648 AND 2147483647000
2489+ THEN
2490+ CONVERT
2491+ (
2492+ nvarchar(30 ),
2493+ DATEADD
2494+ (
2495+ SECOND,
2496+ (
2497+ (
2498+ SUM
2499+ (
2500+ CONVERT
2501+ (
2502+ bigint ,
2503+ dp .wait_time
2504+ )
2505+ )
2506+ )/
2507+ 1000
2508+ ),
2509+ 0
2510+ ),
2511+ 14
2512+ )
2513+ ELSE
24442514 CONVERT
24452515 (
24462516 nvarchar(30 ),
@@ -2461,6 +2531,7 @@ BEGIN
24612531 ),
24622532 14
24632533 )
2534+ END
24642535 FROM # deadlock_owner_waiter AS dow
24652536 JOIN # deadlock_process AS dp
24662537 ON (dp .id = dow .owner_id
@@ -2577,6 +2648,76 @@ BEGIN
25772648 )
25782649 ) +
25792650 N' ' +
2651+ /* the more wait time you rack up the less accurate this gets,
2652+ it's either that or erroring out*/
2653+ CASE
2654+ WHEN
2655+ SUM
2656+ (
2657+ CONVERT
2658+ (
2659+ bigint ,
2660+ wt .total_wait_time_ms
2661+ )
2662+ )/ 1000 > 2147483647
2663+ THEN
2664+ CONVERT
2665+ (
2666+ nvarchar(30 ),
2667+ DATEADD
2668+ (
2669+ MINUTE,
2670+ (
2671+ (
2672+ SUM
2673+ (
2674+ CONVERT
2675+ (
2676+ bigint ,
2677+ wt .total_wait_time_ms
2678+ )
2679+ )
2680+ )/
2681+ 60000
2682+ ),
2683+ 0
2684+ ),
2685+ 14
2686+ )
2687+ WHEN
2688+ SUM
2689+ (
2690+ CONVERT
2691+ (
2692+ bigint ,
2693+ wt .total_wait_time_ms
2694+ )
2695+ ) BETWEEN 2147483648 AND 2147483647000
2696+ THEN
2697+ CONVERT
2698+ (
2699+ nvarchar(30 ),
2700+ DATEADD
2701+ (
2702+ SECOND,
2703+ (
2704+ (
2705+ SUM
2706+ (
2707+ CONVERT
2708+ (
2709+ bigint ,
2710+ wt .total_wait_time_ms
2711+ )
2712+ )
2713+ )/
2714+ 1000
2715+ ),
2716+ 0
2717+ ),
2718+ 14
2719+ )
2720+ ELSE
25802721 CONVERT
25812722 (
25822723 nvarchar(30 ),
@@ -2596,7 +2737,7 @@ BEGIN
25962737 0
25972738 ),
25982739 14
2599- ) +
2740+ ) END +
26002741 N' [dd hh:mm:ss:ms] of deadlock wait time.'
26012742 FROM wait_time AS wt
26022743 GROUP BY
You can’t perform that action at this time.
0 commit comments