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?

Était-ce utile?

La 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.

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top