Recently, when I was doing a batch of data processing performance tuning, I found that the typical audit login and audit logout are not found in sqlprofiler, if the commandtext comment value of the command sentence is not logged out before the update or add operation of the latest row data, if the threshold value is later, logout will be generated. I do not know why. The performance deviation may reach 15%-20%.
If the explain method is as follows:
Create a consumer connected to conn;
Sqlcommand comm = new sqlcommand (conn );
Sqlparameter Param;
String strsql = "Update Table1 set name = @ name"
Comm. commandtext = strsql; // note: the limit value of this sentence is before parameter.
Param. parametername = "@ name ";
Param. value = "value ";
Comm. Parameters. Add (PARAM );
Comm. executenonquery ();
Conn. Close ();
If the explain method is as follows:
Sqlcommand comm = new sqlcommand (conn );
Sqlparameter Param = new sqlparameter ();
String strsql = "Update Table1 set name = @ name"
Param. parametername = "@ name ";
Param. value = "value ";
Comm. Parameters. Add (PARAM );
Comm. commandtext = strsql; // Note: This sentence is after the parameter value parameters.
Comm. executenonquery ();
Conn. Close (); // number of rows connected to logout