| DBCC InputBuffer details for all spids for all databases |
|
|
|
|
DBCC Inputbuffer is the the coomand used to get the statement send from a client(SPID) to sqlserver. For instance DBCC INPUTBUFFER (81) will give the last statement from spid 81. Here is the query to get the InputBuffer details for all SPID across all the databases. Create proc udp_GetInputBuffer Set NoCount On CREATE TABLE #Tempcur ( Create table #InputBuffer (ID int identity,Spid int,Dbname varchar(100),EventType nvarchar(100) null, Insert into #InputBuffer (Spid,Dbname) Insert into #tempcur Select @EventType = EventType, @EventInfo = EventInfo from #tempcur Update #InputBuffer set EventType =@EventType,EventInfo =@EventInfo where ID = @cnt Truncate table #tempcur End Drop Table #InputBuffer Set NoCount Off
Comments (31)
Powered by !JoomlaComment 4.0 beta2
|


