Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 DBCC Inputbuffer

Author  Topic 

prashu
Starting Member

4 Posts

Posted - 2008-12-17 : 08:36:54
I'm trying to troubleshoot a SQL issue. I know it's a blocking issue in SQL 2005...so I go do the following:

1) I find the spid that is causing the block and do an DBCC Inputbuffer(spid)

The issue with this is that it only displays 255 characters. So, I'll only see part of a SQL Query and it truncates. Is there another tool or some kind of parameter I could put on this command so that the results aren't truncated?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-12-17 : 08:39:11
select * from sys.dm_tran_locks where request_session_id = yourspid

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

prashu
Starting Member

4 Posts

Posted - 2008-12-17 : 08:57:27
[quote]Originally posted by spirit1

select * from sys.dm_tran_locks where request_session_id = yourspid

___________________________________________________________________________

Thanks spirit1 for your reply ,

the issue is i'm not able to get the full query from the event_info from DBCC INPUTBUFFER. it is getting truncated. Is there any other way to get the full SQL query statement .
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-12-17 : 09:06:20
ahh sorry... here you go:
http://weblogs.sqlteam.com/mladenp/archive/2008/04/29/SQL-Server-2005-Get-full-information-about-transaction-locks.aspx

play with the statement if you don't get what you need immediatly.

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

prashu
Starting Member

4 Posts

Posted - 2008-12-17 : 09:53:17
Thanks for your reply Spirit1,

i tried that statement but it is not solving my problem .


I created a log file that is intended to capture the sql statement being used to insert/ update/delete a record in a table (see the attached code snippet) but even though I created the statement field to be varchar (4000) the captured statement is being cut off...

Is there any other way to capture the whole statement.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-12-17 : 10:01:46
quote:
i tried that statement but it is not solving my problem


how did you try it? do you know what each dynamic view is doing? how does it not work for you?

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-17 : 10:02:21
You can increase Characters size in Tools-Options-Query Results.
Go to Top of Page

prashu
Starting Member

4 Posts

Posted - 2008-12-17 : 23:55:07
HI spirit1 ,

using that statement , we'l be getting the statement in that
'SqlStatement Text' , if i use it in insert/ update trigger , i'm getting only the whole Trigger statement not the actual insert/update sql statement that got executed
Go to Top of Page
   

- Advertisement -