Home

LinqPad 6 SQL tab displaying the generated SQL multiple times.

When viewing the SQL for a Linq query I often get the same SQL script displayed repeatedly. Is this something that is being generated by my Query or is it some sort of issue with LinqPad 6?

Comments

  • What kind of connection is it?

  • In some cases, with some providers e.g. EF Core 2.1, it will convert a single query into multiple SQL queries - you can tell because the parameter values with the query vary.

  • edited November 13

    The connection type is Entity Framework Core 5 DbContext

    Does the creation of multiple SQL statements mean that it is doing that in my actual program?

  • Does it show multiple statements when you execute a simple query, such as Customers.Take(100)?

    And are you allowing LINQPad to generate the data context automatically, or are you connecting to your own data context assembly?

  • edited November 16

    Simple query returned 1 query.
    Ran a simple Take(10) query on a different table and got two identical queries in the SQL tab.
    Connecting to my own EF .Net 5 data context assembly.

    Using LINQPad 6 Beta

    **Update
    Ran the simple query repeatedly in LINQPad, Every time I ran it it added a duplicate to the SQL query tab. Is this the expected behavior? Or should the SQL tab clear each time? Is there a way to clear the screen between runs of the query?

Sign In or Register to comment.