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
Showing posts with label exact. Show all posts
Showing posts with label exact. Show all posts
Wednesday, March 28, 2012
Friday, February 24, 2012
Indexes and Deadlocks
What are the exact reasons heavily fragmented Indexes can cause Deadlocks?
Is it purely because queries will run faster without fragmentation,
therefore lock escalation will happen quicker?
TIA, ChrisRbasically, yes.
Greg Jackson
PDX, Oregon
Is it purely because queries will run faster without fragmentation,
therefore lock escalation will happen quicker?
TIA, ChrisRbasically, yes.
Greg Jackson
PDX, Oregon
Indexes and Deadlocks
What are the exact reasons heavily fragmented Indexes can cause Deadlocks?
Is it purely because queries will run faster without fragmentation,
therefore lock escalation will happen quicker?
TIA, ChrisRbasically, yes.
Greg Jackson
PDX, Oregon
Is it purely because queries will run faster without fragmentation,
therefore lock escalation will happen quicker?
TIA, ChrisRbasically, yes.
Greg Jackson
PDX, Oregon
Indexes and Deadlocks
What are the exact reasons heavily fragmented Indexes can cause Deadlocks?
Is it purely because queries will run faster without fragmentation,
therefore lock escalation will happen quicker?
TIA, ChrisR
basically, yes.
Greg Jackson
PDX, Oregon
Is it purely because queries will run faster without fragmentation,
therefore lock escalation will happen quicker?
TIA, ChrisR
basically, yes.
Greg Jackson
PDX, Oregon
Subscribe to:
Posts (Atom)