Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

trying to order an alert i created that sends out blocking spids

$
0
0
IF Object_id('tempdb..#blocked') IS NOT NULL DROP TABLE #blockedselect '201' spid,'200' BlockingSPIDinto #blockedunion allselect '199','202'union allselect '202','0'union allselect '200','0'union allselect '568','831'union allselect '819','846'union allselect '831','1051'union allselect '1022','1051'union allselect '1056','831'union allselect '846','831'union allselect '1051','0'union allselect '733','798'union allselect '798','831'union allselect '939','798'select *from #blocked[u][b]Current output[/b][/u]201 200199 202202 0200 0568 831819 846831 10511022 10511056 831846 8311051 0733 798798 831939 798[b][u]Desired Output[/u][/b] 200 0201 200202 0199 2021051 0831 10511022 1051568 831798 831846 8311056 831733 798939 798819 846

Viewing all articles
Browse latest Browse all 3145

Trending Articles