March 8, 2011 at 11:09 pm
DEAR ALL,
HOW CAN I TRACE ALL THE QUERIES WHICH IS RUN IN NEW QUERY WINDOW AND IT AUTOMATICALLY INSERT
INTO A TABLE IN ROW AND COLUMN FORMAT.
EXAMPLE-IF I AM WRITING SELECT ,UPDATE,DELETE,INSERT ETC QUERY
THE QUERY WHICH IS RUN WILL SAVE INTO A TABLE BY COLUMN
USER NAME-> LOGIN NAME
USER MACHINE NAME-> INSTANCE NAME OR PC NAME EG-IVAN-PC,RTM,
QUERY RUN TIME- > WHEN THE QUERY HAS BEEN RUN.
THE ENTIRE QUERY-> EG-SELECT * FROM TABLENAME.
March 9, 2011 at 1:14 am
Please don't post in all caps. It's like shouting at us.
To trace queries executed you need SQL profiler or a Server-side trace. See http://www.sqlservercentral.com/stairway/72363/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 9, 2011 at 5:51 am
dear sir ,
i had gone through the link which u have provided to me but ,
sir it is a trace where i can'nt find the query which is been run and from which machine-pc.
sir plz read my before post carefully .
March 9, 2011 at 6:00 am
Ivan Mohapatra (3/9/2011)
sir it is a trace where i can'nt find the query which is been run and from which machine-pc.
Sorry, I don't understand what you're asking.
If you want something to log all queries that run with the machines they run from, traces will do that. Not automatically, you have to configure them, but they most certainly can. Not straight to table (unless you want to seriously degrade performance) but to a file that you can import into a table. Please re-read the articles (all three) carefully.
sir plz read my before post carefully .
I did read your post completely before I answered.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 9, 2011 at 8:21 am
Based on what you wrote (and yes, I read it too), you have two options. First, set up a serveri-side trace as Gail has already suggested. Second, you can try to do the same thing as the server side trace using extended events.
Frankly, you're better off with the trace, but if you're interested, here's where you can go to learn how to use extended events. Here's a sample for collecting the data.
In the event I'm misunderstanding your question, another option is to use Mladen Prajdic's SSMS Tookpack[/url], which will store each query during a session within SQL Server so you can see what you ran as you ran it.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
March 9, 2011 at 10:34 am
thank you sir,
finally i got the tool which i was searching from 3 months .
thanks to u both.
(thank you ) in hindi ->(Danyabad)
March 9, 2011 at 10:51 am
Which? Three different things were mentioned.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
March 9, 2011 at 10:55 am
sir i used the ssms tool which helped me a lot .
and
thanks
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply