I am trying to optimize my database using the Database Engine Tuning Advisor , and the problem that I encountered is that my SQL Profiler trace shows tons of queries executed using sp_executesqland the adviser cannot process them. It seems that these queries come from the LINQ-to-Entities that I use, so it's just curious if there is a way to get LINQ-to-Entities to invoke statements directly.
sp_executesql
Agree with Adam. Using sp_executesqlentity framework / ADO.net is intentional. The queries are then executed in the same way as the parameterized stored proc and the SQL optimizer, which can reuse the query plan.
If you want to customize your database, you should also consider these queries. I suggest you make a backup of your database, capture queries using the trace trace template (in your SQL profiler), restore your database, launch your configuration advisor, configure your workload for this trace
LINQ/.NET SQL-, sp_executesql SQL-. , , SQL Server, , .
"" sp_executesql, , .
^EXEC[\s]+SP_EXECUTESQL[\s]+[N]*'((''|[^'])*)'[\s]*,[\s]*[N]*'((''|[^'])*)'[\s]*,[\s]*([^\n]+)$
BEGIN\nDECLARE \3\nSELECT \5\n\1\nEND
! , Notepad ++ 6 ( ), , .
, RPC . : ( 0x01) RPC ( 0x03), TDS. SQL , RPC 0x03 0x0A, sp_executesql.
, , , , , , , , sp_executesql. ODBC, OleDB, SqlClient, Sql Native Client, , . Entity Framework, ADO.Net, sp_executesql ( , , , . , @parameter .
@parameter
sp_executesql - ADO.NET, - Entity Framework. , .
Source: https://habr.com/ru/post/1751945/More articles:Zend_Db_Table_Abstract remove - zend-frameworkICU Cycling - c ++Encryption of messages sent to WCF services hosted on a server with a real IP address - security.hide () /. show () and droppable - jqueryTypeError: unsupported operand type - pythonisMemberOfClass versus comparing classes with == - classkeeping a list of all local push notifications in iOS 4 - iphonehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1751948/aspnet-mvc-dynamically-set-css-class-to-list-item-based-on-route&usg=ALkJrhgxno6IHJj15UQEiVhfbQz2pZpMywUnderstanding Purple Layouts - phpIs there a good site to search / vote / discuss ruby gems? - ruby | fooobar.comAll Articles