当前位置:学者斋 >

设计制作 >网页设计 >

SQLserver找出执行慢的SQL语句

SQLserver找出执行慢的SQL语句

复制代码 代码如下:

SQLserver找出执行慢的SQL语句

///

/// 批量执行SQL语句

///

///SQL语句数组

///SQL参数对象数组

///

public static Int32 ExecuteSqls(String[] Sqlstr, Listparam)

{

String ConnStr = GetSqlConnection();

using (SqlConnection conn = new SqlConnection(ConnStr))

{

SqlCommand cmd = new SqlCommand();

SqlTransaction tran = null;

saction = tran;

try

{

();

tran = nTransaction();

ection = conn;

saction = tran;

Int32 count = th;

for (Int32 i = 0; i < count; i++)

{

andText = Sqlstr[i];

ange(param[i]);

uteNonQuery();

}

it();

return 1;

}

catch

{

back();

return 0;

}

finally

{

ose();

e();

}

}

}

  • 文章版权属于文章作者所有,转载请注明 https://xuezhezhai.com/sjzz/sjzz/xv0moe.html