Hello to everybody!
I am a new comer in this forum and also a new user of SQLServer.
I would like to write a transact-SQL script that will permit me, when there is any deadlock,
- to have a list of the processes in deadlock in a ".txt" format or any other format
- to send a message to somebody in its mail account in order to inform him of the problem
- to kill the process which causes the deadlock
All these automatically.
First of all, is it possible?
Then if it is not, can you please give me another solution?
I am using SQLServer 2000.
Thanks in advance.Yes, it's possible:
1.
- to have a list of the processes in deadlock in a ".txt" format or any other format
See: sp_lock (use the help for more info)
2.
- to send a message to somebody in its mail account in order to inform him of the problem
See: xp_sendmail (use the help for more info) :)
3.
- to kill the process which causes the deadlock
See: kill (use the help for more info) :)
Best regards!
:cool:|||check the following page:
http://www.sql-server-performance.com/deadlocks.asp|||Thanx to all for your replies
Botond.baika can you please send me a script example please for all those manipulations?
Thanx.|||I could! :D ...but then you'll miss the fun of learning on your own. The MSSQL help is sufficiently detailed about these SPs. Writing the code instead of you is against my beliefs about teaching people. I could give you THE fish, but then you'll never learn how TO fish. :)
If you run into specifical problems that you can not solve it on your own, and neither help and neither the different posts on forums on the Internet can't help you, then ask us the question and we will answer you. But till then it's just to easy to have somebody else figure it out for you. ;)
If somebody else will do this for you (write the whole thing for you) it's fine with me, but I won't.
Best regards,
Botond BAIKA
Tuesday, March 20, 2012
problems with locks and automation
Labels:
automation,
database,
everybodyi,
locks,
microsoft,
mysql,
oracle,
permit,
script,
server,
sql,
sqlserver,
transact-sql,
user,
write
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment