Tuesday, April 14, 2009

Which query is currently executing to debug the database performance?

Open an interactive sql session to the server you are interested in using Sybase Central.

do and sp_who and see who is running queries at the moment.

dbcc traceon(7201)
go

dbcc sqltext(spid) --- where spid is the id of the client running the query you are interested in
go

This will give you the last executed statement. If your data server isn't a busy one, then this may help you in debugging

No comments: