易截截图软件、单文件、免安装、纯绿色、仅160KB

Sql Server 查询sql执行各个阶段的时间

Sql Server 查询sql执行各个阶段的时间
set statistics io on
set statistics time on
set statistics profile on
go
[你的sql语句]
go
set statistics io off
set statistics time off
set statistics profile off

我运行:
set statistics io on
set statistics time on
set statistics profile on
go
select * from Users
go
set statistics io off
set statistics time off
set statistics profile off
结果:
SQL Server 执行时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。
SQL Server 执行时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。
SQL Server 分析和编译时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。
SQL Server 分析和编译时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。
(所影响的行数为 1 行)
表 'Users'。扫描计数 1,逻辑读 2 次,物理读 0 次,预读 0 次。
SQL Server 执行时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。
(所影响的行数为 2 行)
SQL Server 执行时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。
SQL Server 执行时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。
SQL Server 分析和编译时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。
SQL Server 执行时间:
   CPU 时间 = 0 毫秒,耗费时间 = 0 毫秒。


相关文档:

SQL大全

一、基础
1、说明:创建数据库
CREATE DATABASE database-name
2、说明:删除数据库
drop database dbname
3、说明:备份sql server
--- 创建 备份数据的 device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- 开始 备份
BACKUP DATABASE pubs TO testBack
4、说 ......

使用c#创建sql server的存储过程_c#应用2

{
SqlConnection cnn = new SqlConnection
("context connection=true");
cnn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = cnn;
cmd.CommandText = "select * from customers";
SqlDataReader reader = cmd.ExecuteReader();
SqlContext.Pipe.Send(reader);
reader.Close();
cnn.Close();
}
......

hibernate 打印SQL语句到控制台

只需要在配置文件里         hibernate.show_sql=true
    <property name="hibernateProperties">
      <value>
        hibernate.dialect=org.hibernate.dialect.Oracle9Dialect ......

ADO.NET与ORM的比较(3):Linq to SQL实现CRUD

  说明:个人感觉在Java领域大型开发都离不了ORM的身影,所谓的SSH就是Spring+Struts+Hibernate,除了在学习基础知识的时候被告知可以使用JDBC操作数据库之外,大量的书籍中都是讲述使用Hibernate这个ORM工具来操作数据。在.NET中操作数据库的方式有多种,除了最直接的方式就是使用ADO.NET之外,还可以使用NHiber ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号