Happy New Year to all
Question,
If i have a spid like this:
1)Sleeping
2)Last_wait type: PAGEIOLATCH_SH
3)wait ressource: 7:1:1246732
4)cmd: AWAITING COMMAND
5) it=B4s a day old and is comming from someone's pc
could it be possible that even though that spid is sleeping its holding a "lock" on the ressource 7:1:1246732?
ThanxsYou can run the sp_lock procedure and see if this spid has a lock on any
resources.
Rand
This posting is provided "as is" with no warranties and confers no rights.
Showing posts with label spid. Show all posts
Showing posts with label spid. Show all posts
Wednesday, March 28, 2012
Info!
Hi All, 2 doubts
1. How can I retrieve the exact command (T-SQL) being executed by an SPID on
the query Analyzer. You can get the same info using Ent. Mgr and right click
on SPID.
2. What's the best technic (light weight method) to log errors from a Stored
Proc? I don't wanna use xp_cmdshell...
TIA1) DBCC INPUTBUFFER (SPID) capped at 255 I believe, or use
fn_get_sql() SP3 + on SQl server 2000 take a look here
(http://vyaskn.tripod.com/fn_get_sql.htm)
2) log the errors in a ErrorLog table with procname, date, any other
info (parameters maybe) etc
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||DBCC INPUTBUFFER (SPID)
note - it will truncate the statement after a particular length.
"Vai2000" <nospam@.microsoft.com> wrote in message
news:e9STBJddGHA.1204@.TK2MSFTNGP02.phx.gbl...
> Hi All, 2 doubts
> 1. How can I retrieve the exact command (T-SQL) being executed by an SPID
> on
> the query Analyzer. You can get the same info using Ent. Mgr and right
> click
> on SPID.
> 2. What's the best technic (light weight method) to log errors from a
> Stored
> Proc? I don't wanna use xp_cmdshell...
> TIA
>|||> 2. What's the best technic (light weight method) to log errors from a Storedd">
> Proc? I don't wanna use xp_cmdshell...
Where do you want these errors to be logged? RAISERROR and xp_logevent can b
e options, but hard to
tell without more info.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Vai2000" <nospam@.microsoft.com> wrote in message news:e9STBJddGHA.1204@.TK2MSFTNGP02.phx.gb
l...
> Hi All, 2 doubts
> 1. How can I retrieve the exact command (T-SQL) being executed by an SPID
on
> the query Analyzer. You can get the same info using Ent. Mgr and right cli
ck
> on SPID.
> 2. What's the best technic (light weight method) to log errors from a Stor
ed
> Proc? I don't wanna use xp_cmdshell...
> TIA
>sql
1. How can I retrieve the exact command (T-SQL) being executed by an SPID on
the query Analyzer. You can get the same info using Ent. Mgr and right click
on SPID.
2. What's the best technic (light weight method) to log errors from a Stored
Proc? I don't wanna use xp_cmdshell...
TIA1) DBCC INPUTBUFFER (SPID) capped at 255 I believe, or use
fn_get_sql() SP3 + on SQl server 2000 take a look here
(http://vyaskn.tripod.com/fn_get_sql.htm)
2) log the errors in a ErrorLog table with procname, date, any other
info (parameters maybe) etc
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||DBCC INPUTBUFFER (SPID)
note - it will truncate the statement after a particular length.
"Vai2000" <nospam@.microsoft.com> wrote in message
news:e9STBJddGHA.1204@.TK2MSFTNGP02.phx.gbl...
> Hi All, 2 doubts
> 1. How can I retrieve the exact command (T-SQL) being executed by an SPID
> on
> the query Analyzer. You can get the same info using Ent. Mgr and right
> click
> on SPID.
> 2. What's the best technic (light weight method) to log errors from a
> Stored
> Proc? I don't wanna use xp_cmdshell...
> TIA
>|||> 2. What's the best technic (light weight method) to log errors from a Storedd">
> Proc? I don't wanna use xp_cmdshell...
Where do you want these errors to be logged? RAISERROR and xp_logevent can b
e options, but hard to
tell without more info.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Vai2000" <nospam@.microsoft.com> wrote in message news:e9STBJddGHA.1204@.TK2MSFTNGP02.phx.gb
l...
> Hi All, 2 doubts
> 1. How can I retrieve the exact command (T-SQL) being executed by an SPID
on
> the query Analyzer. You can get the same info using Ent. Mgr and right cli
ck
> on SPID.
> 2. What's the best technic (light weight method) to log errors from a Stor
ed
> Proc? I don't wanna use xp_cmdshell...
> TIA
>sql
Subscribe to:
Posts (Atom)