Microsoft C++ exception: SqlException at memory location

Posted BBinChina

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Microsoft C++ exception: SqlException at memory location相关的知识,希望对你有一定的参考价值。

Microsoft C++ exception: SqlException at memory location

1,查看CPU占用量最高的会话及SQL语句

select  spid,cmd,cpu,physical_io,memusage,
(select  top  1  [text]  from  ::fn_get_sql(sql_handle))  sql_text
from  master…sysprocesses  order  by  cpu  desc,physical_io  desc

2,查看缓存重用次数少,内存占用大的SQL语句

SELECT  TOP  100  usecounts,  objtype,  p.size_in_bytes,[sql].[text] 
FROM  sys.dm_exec_cached_plans  p  OUTER  APPLY  sys.dm_exec_sql_text  (p.plan_handle)  sql 
ORDER  BY  usecounts,p.size_in_bytes    desc
————————————————

SELECT
SPID = er.session_id
,Status = ses.status
,[Login] = ses.login_name
,Host = ses.host_name
,BlkBy = er.blocking_session_id
,DBName = DB_Name(er.database_id)
,CommandType = er.command
,SQLStatement = st.text
,ObjectName = OBJECT_NAME(st.objectid)
,ElapsedMS = er.total_elapsed_time
,CPUTime = er.cpu_time
,IOReads = er.logical_reads + er.reads
,IOWrites = er.writes
,LastWaitType = er.last_wait_type
,StartTime = er.start_time
,Protocol = con.net_transport
,ConnectionWrites = con.num_writes
,ConnectionReads = con.num_reads
,ClientAddress = con.client_net_address
,Authentication = con.auth_scheme
FROM sys.dm_exec_requests er
OUTER APPLY sys.dm_exec_sql_text(er.sql_handle) st
LEFT JOIN sys.dm_exec_sessions ses
ON ses.session_id = er.session_id
LEFT JOIN sys.dm_exec_connections con
ON con.session_id = ses.session_id
WHERE er.session_id > 50
ORDER BY
er.blocking_session_id DESC
,er.session_id

以上是关于Microsoft C++ exception: SqlException at memory location的主要内容,如果未能解决你的问题,请参考以下文章

❥关于C++之异常

System.Exception:“Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册 [重复]

[Exception JavaWeb 1] - Cause: com.microsoft.sqlserver.jdbc.SQLServerException: '@P2' 附近有语法错

C++ exception类:C++标准异常的基类

C++ 异常和来自 std::exception 的继承

C++学习41 exception类