Link to home
Start Free TrialLog in
Avatar of ohemaa
ohemaa

asked on

Db Blocking/Locking

I need a script that can send an email to Ohemaa@yahoo.com when
there is

1. a lock on the database Customer  
2. The head of the blocking chain
3. the query that the spid that is blocking is running....

Avatar of SQL_SERVER_DBA
SQL_SERVER_DBA
Flag of United States of America image

CREATE Proc sp_getlocks

I'm sure this will answer your questions...
http://articles.techrepublic.com.com/5100-9592_11-6088055.html

alittle more you.
 http://msdn2.microsoft.com/en-us/library/ms187749.aspx as well as doing a google search for more information on lock types, etc.
Avatar of ohemaa
ohemaa

ASKER

I have seen all these links.  just not sure how to put it all in a nice simple script..
ASKER CERTIFIED SOLUTION
Avatar of SQL_SERVER_DBA
SQL_SERVER_DBA
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ohemaa

ASKER

Does not alert me.   I am looking for some form of alert so that we ca resolve the issue before users start calling
1. a lock occurs on  database  
2. The head of the blocking chain or who is causing the locking/blocking
3. the query that the spid that is blocking is running....