August 2, 2006 at 7:48 pm
Greetings one and all,
I need to find all the current sql statments that are running with out having to use profiler. What tables do I need to interrigate to find this please.
Much appreciated.
Hope this helps...
Ford Fairlane
Rock and Roll Detective
August 2, 2006 at 10:36 pm
The following might bive you what you are after
Declare mycursor Cursor for Select 'Print ' + convert (varchar, spid) + '
dbcc inputbuffer ( ' + convert (varchar , spid ) + ')'
From sysprocesses
Where spid >13
Declare @sql Varchar (1000)
Open mycursor
Fetch Next From mycursor into @sql
While @@Fetch_Status = 0
Begin
Exec (@SQL)
Fetch Next From mycursor into @sql
End
Deallocate mycursor
August 2, 2006 at 11:34 pm
That is very much along the lines of what I need, however to trow a spanner in the works, I am in a tight bind..
I am the DBA for company A lets say, and we outsource for what ever reason only the powers that be know, company B to look after the database. Part of what I have to do is the application support so I need to be able to run profiler. However Company B will not give me sysadmin role to do so, nor am I able to runn ANY DBCC commands. So what I need to be able to do, is like in oracle query a table directly to gather the information regarding what sql text is running......
Hope this helps...
Ford Fairlane
Rock and Roll Detective
August 3, 2006 at 2:14 am
So basically your management are asking you to run a marathon but have chopped off your legs?
August 3, 2006 at 6:49 am
For the lack of a better solution. Have that company run the traces for you and send you the output files. Worst case is, it's your code that is running. Get with your developers and analyze the statements in their code.
Not the best easiest things to do, but I suppose you have to make things work.
Tom
August 3, 2006 at 6:45 pm
That is the solution that has been thrown around, have the 3rd part Co run Profilier and send me the output. I was hoping to be able to look at tables and get the info myself, but not much you can do with out legs....''Thanks for your input
Hope this helps...
Ford Fairlane
Rock and Roll Detective
August 4, 2006 at 3:42 pm
run "limited" server side traces... they have minimal impact on the system
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply