sql-server-profiler

How do I capture the data passed in SqlBulkCopy using the Sql Profiler?

ε祈祈猫儿з 提交于 2020-01-22 11:59:38
问题 I am using Sql Profiler all the time to capture the SQL statements and rerun problematic ones. Very useful. However, some code uses the SqlBulkCopy API and I have no idea how to capture those. I see creation of temp tables, but nothing that populates them. Seems like SqlBulkCopy bypasses Sql Profiler or I do not capture the right events. 回答1: Capturing event info for bulk insert operations ( BCP.EXE , SqlBulkCopy , and I assume BULK INSERT , and OPENROWSET(BULK... ) is possible, but you won't

How do I capture the data passed in SqlBulkCopy using the Sql Profiler?

左心房为你撑大大i 提交于 2020-01-22 11:58:26
问题 I am using Sql Profiler all the time to capture the SQL statements and rerun problematic ones. Very useful. However, some code uses the SqlBulkCopy API and I have no idea how to capture those. I see creation of temp tables, but nothing that populates them. Seems like SqlBulkCopy bypasses Sql Profiler or I do not capture the right events. 回答1: Capturing event info for bulk insert operations ( BCP.EXE , SqlBulkCopy , and I assume BULK INSERT , and OPENROWSET(BULK... ) is possible, but you won't

Help with SQL Trace

本小妞迷上赌 提交于 2020-01-17 09:05:25
问题 I have setup SQL Profiler as follows - Template: Tuning Save to dbo.myTable Event selection: Duration greater than or equal to 2000 (ms) This will record TextData, Duration, SPID, DatabaseID, DatabaseName, ObjectType, LoginName for the events RPC:Completed, SP:StmtCompleted & SQL:BatchCompleted. I exported the script for the SQL Trace and the script below was created. However I need the trace to write to a database table rather than a file. How do I change the script to write to a db table

Linq-To-SQL Multiple Trips to the Database

心已入冬 提交于 2020-01-13 19:22:09
问题 I'm trying to make my Linq-to-SQL query more efficient by including child properties in one trip to the DB. I started by trying various linq queries to accomplish this. The queries were getting complex, so I tried the LoadWith() option: The constructor of my DAL class sets the LoadWith() settings: public TrackerJobData() { dataLoadOptions = new DataLoadOptions(); dataLoadOptions.LoadWith<TrackerJobRecord>(x => x.SpecBarcodeRecords); dataLoadOptions.LoadWith<TrackerJobRecord>(x => x

SQL server profiler not showing LINQ To Sql queries

被刻印的时光 ゝ 提交于 2020-01-12 02:50:47
问题 I am trying to view SQL generated by Linq to SQL in the SQL Server Profiler (2005). I can see the sql sent to the server from anything except for linq to sql. I'm betting that I need to change event selections for the trace, but not sure what else to select. I am currently only selecting this: SQL:StmtCompleted - TextData & SPID I don't want to use data context logging nor the SQL Debug Visualizer. I need to use the profiler. Why can I not see the LINQ to SQL queries? Thanks. EDIT I added SQL

Profiler for MSAccess

孤者浪人 提交于 2020-01-04 05:50:51
问题 I have a MSAccess .mdb file backed with sql server. When i am trying to open a form ,It takes a long time to display I know i had stuff on load event of Form. Is there any way to track execution time in MSAccess like SQL Profiler? 回答1: Faheem; I have never seen such tracking software. A simple, 'old school' method: Place a msgBox at the end of each function call. Once you have isolated which function is running longer than expected, examine the function. Are your recordsets utilizing indexed

LINQ + TransactionScope will not change isolation level in SQL Server Profiler

笑着哭i 提交于 2020-01-03 16:51:18
问题 I'm using the following format for commiting changes to my db using linq. Begin Transaction (Scope Serialized, Required) Check Business Rule 1...N MyDataContext.SubmitChanges() Save Changes Done In Previous Query To Log File End Transaction Scope But in the SQL Server profiler I see the following line in the Connection:Start. set transaction isolation level read committed I went through this (http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/93a45026-0425-4d49-a4ac

Parameterized SQL and NULL running slow

喜欢而已 提交于 2020-01-02 15:26:23
问题 I'm calling some parametrized sql from .net. I'm not sure why but the sql runs quite slow when checking if the parameter is NULL compared to when its not included: So this: exec sp_executesql N' SELECT [id] FROM [tblAddress] (nolock) WHERE 1 = 1 AND ([id] = @id OR @id IS NULL) ',N'@id int', @id=4395 Runs quicker then this: exec sp_executesql N' SELECT [id] FROM [tblAddress] (nolock) WHERE 1 = 1 AND ([id] = @id) ',N'@id int', @id=4395 Running SQL profiler the duration of the top query over 1

Can SQL Begin Try/Catch be lying to me (in the profiler)?

我怕爱的太早我们不能终老 提交于 2019-12-30 17:51:47
问题 I'm calling a stored proc from BizTalk server and trying to debug it. 1) Use SQL Debugger when stored proc called by an external process 2) Getting sp_tracegenerateevent to work in a stored procedure I've been using SQL Profiler as my only tool to know what's going on. But now, I'm doubting if my try/catches are working correctly or not. Code works fine when running in SSMS, but when running from BizTalk sometimes seems like try/catch is catching all the time. ALTER PROCEDURE WhatItsName

Logging erroneous queries only on SQL server

﹥>﹥吖頭↗ 提交于 2019-12-29 05:34:10
问题 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