I have a problem with the company I work in, some people are using SQL in the wrong way causing blocks that naturally crash the whole system, but we are not able to catch who is doing this, because when perceiving the person for the process.
I wonder if there is any way to save the data from the blocks?
As soon as something happens it will save the data as SPID, Login, HostName, DBName, Command
and of course if possible to pull and save the script that the guy is running. I usually see through:
dbcc inputbuffer (SPID)
I already gave a Google and I did not find it, so I came here.
Thanks in advance.
PS: Sorry for the English from Google Translate