sql-server-profiler

Can SQL Profiler display return result sets alongside the query?

China☆狼群 提交于 2019-12-18 03:52:41
问题 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 回答1: 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

SQL query executing slowly (for some parameter values)

大憨熊 提交于 2019-12-13 15:27:15
问题 I have a SQL Server 2005 database with several tables. One of the tables is used to store timestamps and message counters for several devices, and has the following columns: CREATE TABLE [dbo].[Timestamps] ( [Id] [uniqueidentifier] NOT NULL, [MessageCounter] [bigint] NULL, [TimeReceived] [bigint] NULL, [DeviceTime] [bigint] NULL, [DeviceId] [int] NULL ) Id is the unique primary key (Guid.Comb), and I have indexes on both DeviceId and MessageCounter columns. What I want to do is find the last

Trace file - how to use it

狂风中的少年 提交于 2019-12-10 23:31:59
问题 we have an application running on an IIS 6/ASP.NET 2.0 backed by a SQL Server 2005 STD edition X64. From time to time, the application crashes with some silly messages (some of the fileds are not found into a "select firled1, filed2.. from mytable"). I obtained a trace of the activity from the sql server taken while the application reported the errors. Note: the crash is encountered only during some heavy load on that server, like creating some reports simmultaneously by several users. The

What to look for when setting UpdateBatchSize

我的梦境 提交于 2019-12-10 23:12:33
问题 I have a .NET application that is merging two datatables with a lot of rows (10,000+). There is a good chance of having a large number of update/inserts to perform to the SQL table when using the DataAdapter.Update command. Right now, I have the Adapter UpdateBatchSize property set to 200. VS warns against setting this value too high because it may decrease performance. Ok, gotcha. Performance wise, what should I look for when setting this property? No matter what, updating lots of rows will

SQL Server Profiler: How to inspect/understand the duration for the Audit Logout event in more detail?

橙三吉。 提交于 2019-12-10 11:36:21
问题 I am profiling some MS SQL queries with the SQL Server Profiler for my C# Application that I develop with Visual Studio and IIS Express: The duration that is given for the event "Audit Logout" (16876 ms) is the total time between login and logout. The duration for the query is only 60 ms. Login/Logout events are related to the setting up / tearing down. From What is "Audit Logout" in SQL Server Profiler? I would like to understand the time difference of 16816 ms (= 16876 ms - 60ms) in more

What are the APIs used by SQL Profiler?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 09:51:22
问题 SQL Server Profiler displays a live stream of commands being executed against a SQL server instance. What are the APIs used to capture this data? Background: I need to write a small utility (in C++) which tracks the SQL commands being issued by a separate application. 回答1: Here on the API Development Team Blog is a quick C# (should be easy to convert to c++) program which connects to SQL Server and shows the text of all starting batches in real time as the requests are coming to SQL Server. e

Can profiler templates be migrated to newer versions of SQL Profiler?

淺唱寂寞╮ 提交于 2019-12-10 02:44:59
问题 Is it possible to migrate Profiler templates to newer versions of SQL Server? In my case I want to take my SQL 2008 templates to 2012. I've tried (1) a straight file copy and (2) an export/import. In both cases the older templates run, but cannot be modified. Modifications result in the following error: I've got a bunch of custom templates and I'm trying to avoid recreating them by hand. Although, I guess that is the fallback position. Thoughts? 回答1: Export the template from SQL Server 2008's

Change Application Name in Sql Server Profiler

China☆狼群 提交于 2019-12-08 16:49:03
问题 When profiling a .Net Application in SQL Server Profiler the default Application Name is taken from the Data Provider. How can I change this to my own Application Name? 回答1: Just add Application Name=My Application; to the Connectionstring Example: connectionString="Server=mySqlServer;Initial Catalog=myDatabase;User id=aUser;Password=aPassword;Application Name=My Application;" You can also use App=My Application 来源: https://stackoverflow.com/questions/27147192/change-application-name-in-sql

Is it possible to automate SQL Server 2008 profiler?

泪湿孤枕 提交于 2019-12-07 10:52:56
问题 There was a post regarding useful SQL tricks. Here I was going to mention the SQL Server Profiler tool, as it has helped me write less SQL. I would write SQL that would interrogate, understand or second guess the databases business logic. Profiler is very useful, especially where application code has embedded SQL and you want to work out what it's doing, in the shortest time possible. (Also you may not know which source code version is used in the application's enviroment, or even worse,

SQL Server Profiler: How to inspect/understand the duration for the Audit Logout event in more detail?

假如想象 提交于 2019-12-06 19:54:33
I am profiling some MS SQL queries with the SQL Server Profiler for my C# Application that I develop with Visual Studio and IIS Express: The duration that is given for the event "Audit Logout" (16876 ms) is the total time between login and logout. The duration for the query is only 60 ms. Login/Logout events are related to the setting up / tearing down. From What is "Audit Logout" in SQL Server Profiler? I would like to understand the time difference of 16816 ms (= 16876 ms - 60ms) in more detail. a) Is it possible to log more events (like a "debug mode")? b) Is it right to assume that the