sql-server-profiler

What is “Audit Logout” in SQL Server Profiler?

試著忘記壹切 提交于 2019-11-30 01:05:53
I'm running a data import (using C#/Linq), and naturally I'm trying to optimize my queries as much as possible. To this end I'm running a trace on the DB using SQL Server Profiler, with my trace filtered by my SQL login name (it's a name that can uniquely be attributed to my data import process). Strangely enough, most of my SQL statements are really quick :) - very few queries even break over the 1ms mark. But spaced in between all my queries are several rows where the EventClass is "Audit Login" or "Audit Logout" - and the duration of an "Audit Logout" can be up to a minute! Has this got

SQL Server Profile - View Parameter Values?

可紊 提交于 2019-11-29 13:49:53
问题 In SQL Server Profile, I have it tracing SP:StmtStarting events. The "TextData" includes information like the following: EXEC MySortedProc @param, NULL, @param2, NULL What would I have to trace (or can I?) to view the value of those parameters? 回答1: Somewhat scared to have misunderstood the question, but you could profile on the RPC:Completed event which will return the result for stored procedure execution in the textdata column like: exec usp_yourproc @param = 'value' 回答2: If I get you

How do I get parameter values for SQL Server query in SQL Server Profiler

ぃ、小莉子 提交于 2019-11-29 13:23:12
I'm trying to analyze a deadlock in SQL Server 2008 profiler. I know how to find the offending sql queries, but the collected queries do not include parameter values. I other words I can see something like this: DELETE FROM users WHERE id = @id But what I would like to see is this: DELETE FROM users WHERE id = 12345 I guess there are some additional events or Columns I need to collect in the profiler, but I don't know which. I am currently using the "TSQL_LOCKS" template. Any hints would be greatly appreciated. Thanks, Adrian Disclaimer: I've asked a similar question before, but I guess it was

Stored procedure output parameters in SQL Server Profiler

妖精的绣舞 提交于 2019-11-29 09:44:00
I've got a stored procedure with an int output parameter. If I run SQL Server Profiler, execute the stored procedure via some .Net code, and capture the RPC:Completed event, the TextData looks like this: declare @p1 int set @p1=13 exec spStoredProcedure @OutParam=@p1 output select @p1 Why does it look like it's getting the value of the output parameter before executing the stored procedure? The RPC:Completed event class indicates that a remote procedure call has been completed. So the output parameter is actually known at that point. See if tracing the RPC:Started shows you what you expect.

SQL Profiler CPU / duration units

五迷三道 提交于 2019-11-29 04:25:00
问题 The output from a SQL Server trace in profiler contains the columns CPU and Duration (amongst others). What units are these values in? 回答1: CPU is in milliseconds. In sql server 2005 and later, duration is in microseconds when saved to a file or a table, and milliseconds in the user interface. In sqlserver 2000, it is always in milliseconds. From MSDN. User jerryhung gives a more accurate version-specific information in a comment: Beginning with SQL Server 2005, the server reports the

SQL Server Profiler - How to filter trace to only display TSQL containing a DELETE statement?

Deadly 提交于 2019-11-29 02:53:16
问题 I have a SQL Trace setup to monitor all TSQL being issued to a single database. However I only care about 'DELETE' TSQL statements being issued. Is there any way I can filter to just reporting these type of statements to the profiler? Thanks! 回答1: When setting up your trace, go to event selection and select only TSQL->Batch completed . Now click the column filters button and choose TextData -> Like and write %delete% . That should do it. EDIT : Added percent signs ( % ) around delete because

Can SQL Profiler display return result sets alongside the query?

烈酒焚心 提交于 2019-11-29 02:52:01
In SQL Profiler 2005, is it possible to capture a result set in a SQL trace, so that I could see corresponding queries with result sets? ...Or is it only a one way trace? Thanks! George No, you can't get the resultset produced by a query included in an SQL trace. You can only tell various statistics about the call (i.e. the query executed, duration, reads etc etc). Output parameter values are recorded in the trace (if you parse TextData), and you can get it to include the rowcount info in the trace alongside the query. It just won't show you the actual resultset returned by the query. No, you

Logging erroneous queries only on SQL server

穿精又带淫゛_ 提交于 2019-11-29 02:26:59
I have what would seem to be an easy goal to accomplish, yet I have not found a good solution. Google does not shed a light on it and I just hope that I have been looking for a solution in wrong places or just tried to use tools in a wrong way... Or perhaps it is already too late for me today to think clearly :) But this is where you can help me out, I hope. I need to be able to log erroneous queries only which were executed on a specific instance of SQL Server. I thought that SQL Profiler would allow me to do it in no time, but I have not been able to find a combination of settings that would

SQL Server Profiler - How to filter trace to only display events from one database?

馋奶兔 提交于 2019-11-28 14:56:23
How do I limit a SQL Server Profiler trace to a specific database? I can't see how to filter the trace to not see events for all databases on the instance I connect to. Under Trace properties > Events Selection tab > select show all columns. Now under column filters, you should see the database name. Enter the database name for the Like section and you should see traces only for that database. Todd Price In SQL 2005, you first need to show the Database Name column in your trace. The easiest thing to do is to pick the Tuning template, which has that column added already. Assuming you have the

Stored procedure output parameters in SQL Server Profiler

天大地大妈咪最大 提交于 2019-11-28 03:05:17
问题 I've got a stored procedure with an int output parameter. If I run SQL Server Profiler, execute the stored procedure via some .Net code, and capture the RPC:Completed event, the TextData looks like this: declare @p1 int set @p1=13 exec spStoredProcedure @OutParam=@p1 output select @p1 Why does it look like it's getting the value of the output parameter before executing the stored procedure? 回答1: The RPC:Completed event class indicates that a remote procedure call has been completed. So the