Question

I have enable EF 6 Log Functionality into my application:

// Add loggin (DEVELOPMENT ONLY)
DbContext.Database.Log = logInfo => System.Diagnostics.Debug.WriteLine(logInfo);

Its working fine but I see like repeated SQL Queries in my Console, so I opened a SQL Profiler and saw the following:

enter image description here

There is a SQL: BatchStarting and SQL: BatchCompleted any clue what does that mean? Is that correct?

Was it helpful?

Solution

It just means that one SQL batch has started and completed.

So,

  • SQL: BatchStarting: an SQL statement/batch has started.
  • SQL: BatchCompleted: that same SQL statement/batch has been completed.

That way you can eg: measure the time needed to execute that specific SQL statement/batch.

This does not mean that two different SQL statements has been executed.

OTHER TIPS

The SQL:BatchStarting event class indicates that a Transact-SQL batch is starting directly from the site MSDN/Technet more detailed writeup

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top