代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
MSSQL
】
SQL2008系统统计函数
作者:
kkun
/ 发布于
2011/8/7
/
949
<div> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* SQL2008系统统计函数 */</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@CONNECTIONS</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@CPU_BUSY</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@IDLE</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@IO_BUSY</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@PACK_RECEIVED</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@PACK_SENT</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@TIMETICKS</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@TOTAL_ERRORS</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@TOTAL_READ</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@TOTAL_WRITE</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 下面的示例显示了如何返回截至当前日期和时间的登录尝试次数。</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">Today's Date and Time Login Attempts</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">----------------------- --------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">2011-08-03 10:59:27.507 199193667 */</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> GETDATE() <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Today'</span><span style="color: rgb(0,96,128)">'s Date and Time'</span>,@@CONNECTIONS <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Login Attempts'</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 以下示例显示了返回当前日期和时间之前的 SQL Server CPU 活动。为了避免将此值转换为微秒时出现算术溢出,此示例将其中一个值转换为 float 数据类型。 </span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">CPU microseconds As of</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">---------------------- -----------------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">1825814468750 2011-08-03 10:59:12.553*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@CPU_BUSY</span> * <span style="color: rgb(0,0,255)">CAST</span>(@@TIMETICKS <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,0,255)">FLOAT</span>) <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'CPU microseconds'</span>, GETDATE() <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'As of'</span> ;</pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 下面的示例返回在开始时间和当前时间之间 SQL Server 已经用于执行输入/输出操作的毫秒数。为了避免将值转换为微秒时出现算术溢出,此示例将其中一个值转换为 float 数据类型。 </span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">IO microseconds as of</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">---------------------- -----------------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">13459500000 2011-08-03 10:59:38.340*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> @@IO_BUSY*<span style="color: rgb(0,0,255)">CAST</span>(@@TIMETICKS <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,0,255)">FLOAT</span>) <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'IO microseconds'</span>, GETDATE() <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'as of'</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 以下示例将返回 SQL Server 自启动到当前时间的空闲毫秒数。为了避免将值转换为微秒时出现算术溢出,此示例将其中一个值转换为 float 数据类型。 </span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">Idle microseconds as of</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">---------------------- -----------------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">45520113250000 2011-08-03 10:59:48.177*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@IDLE</span> * <span style="color: rgb(0,0,255)">CAST</span>(@@TIMETICKS <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,0,255)">FLOAT</span>) <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Idle microseconds'</span>,GETDATE() <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'as of'</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 下面的示例返回在开始时间和当前时间之间 SQL Server 已经用于执行输入/输出操作的毫秒数。为了避免将值转换为微秒时出现算术溢出,此示例将其中一个值转换为 float 数据类型。 </span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">IO microseconds as of</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">---------------------- -----------------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">13459656250 2011-08-03 10:59:57.417*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> @@IO_BUSY*<span style="color: rgb(0,0,255)">CAST</span>(@@TIMETICKS <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,0,255)">FLOAT</span>) <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'IO microseconds'</span>,GETDATE() <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'as of'</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 返回 SQL Server 自上次启动后从网络读取的输入数据包数。</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">Packets Received</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">----------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">229934446*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@PACK_RECEIVED</span> <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Packets Received'</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 返回 SQL Server 自上次启动后写入网络的输出数据包个数。 */</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@PACK_SENT</span> <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Pack Sent'</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 返回每个时钟周期的微秒数。每个时钟周期的时间量依赖于计算机。操作系统的一个时钟周期是 31.25 毫秒,或是三十分之一秒。 </span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">Time Ticks</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">-----------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">31250*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@TIMETICKS</span> <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Time Ticks'</span>;</pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 返回自上次启动 SQL Server 之后 SQL Server 所遇到的磁盘写入错误数。以下示例显示了 SQL Server 到当前日期和时间为止所遇到的错误数。 </span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">Errors As of</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">----------- -----------------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">0 2011-08-03 11:00:20.163*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@TOTAL_ERRORS</span> <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Errors'</span>, GETDATE() <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'As of'</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 返回 SQL Server 自上次启动后由 SQL Server 读取(非缓存读取)的磁盘的数目。以下示例显示了如何返回到当前日期和时间为止的磁盘读写总次数的过程。 </span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">Reads Writes As of</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">----------- ----------- -----------------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">5287348 9854759 2011-08-03 11:00:27.910*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@TOTAL_READ</span> <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Reads'</span>, <span style="color: rgb(204,102,51)">@@TOTAL_WRITE</span> <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Writes'</span>, GETDATE() <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'As of'</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"> </pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">/* 返回自上次启动 SQL Server 以来 SQL Server 所执行的磁盘写入数。以下示例显示了如何返回到当前日期和时间为止的磁盘读写总次数的过程。 </span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">Reads Writes As of</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">----------- ----------- -----------------------</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: rgb(244,244,244); margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,128,0)">5287348 9854796 2011-08-03 11:00:34.880*/</span></pre> <!--CRLF--> <pre style="text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: "Courier New", courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: rgb(0,0,255)">SELECT</span> <span style="color: rgb(204,102,51)">@@TOTAL_READ</span> <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Reads'</span>, <span style="color: rgb(204,102,51)">@@TOTAL_WRITE</span> <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'Writes'</span>, GETDATE() <span style="color: rgb(0,0,255)">AS</span> <span style="color: rgb(0,96,128)">'As of'</span></pre> </div>
试试其它关键字
统计函数
同语言下
.
SQL查询 多列合并成一行用逗号隔开
.
查看存储过程修改时间,最近执行时间
.
设置手动批量删除数据库相关进程
.
获取某个表中特定字段的所有字符串形式
.
SQL 如何去除重复的字符串
.
怎么去掉一个字段中的重复数据
.
String 去除空格 回车 换行 水平制表符
.
SQL查询和替换含有回车,空格,TAB
.
SQL SERVER 查询每日新增用户数量、次留数量
.
判断两个字符串是否存在相同的内容
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
kkun
贡献的其它代码
(
1
)
.
SQL2008系统统计函数
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3