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

令人兴奋的sql server 2005 分页功能!!

先来一段代码:
WITH OrderedOrders AS
(SELECT *,
ROW_NUMBER() OVER (order by [id])as RowNumber  --id是用来排序的列
from table_info ) --table_info是表名
SELECT *
from OrderedOrders
WHERE RowNumber between 50 and 60;
在windows server 2003, sql server 2005 CTP,P4 2.66GHZ,1GB 内存下测试,执行时间0秒 [lol] ,表中数据量230万
接下来大批量的数据查询性能瓶颈就在count了,不知道sql server 2005在这方面有没有什么改进.
附另一种方法:
SELECT *
from (select *,ROW_NUMBER() Over(order by id) as rowNum from table_info ) as myTable
where rowNum between 50 and 60;
参考:
SQL Server 2005中的T-SQL增强
http://info.hustonline.net/document/doc.aspx?ID=1744


相关文档:

Linq to SQL DataContext Lifetime Management


Linq to SQL uses a DataContext to manage it's access to the database as well as tracking changes made to entities retrieved from the database. Linq to SQL has a persistent approach to managing its 'connection' to the database via this data context and it basically assumes that you use a single Dat ......

PL/SQL初学者必读:几十个实用的PL/SQL

第一阶段
Q.编写一个PL/SQL程序块以显示所给出雇员编号的雇员的详细信息。
A.
 DECLARE
 erec emp%ROWTYPE;
BEGIN
 SELECT * INTO erec from emp  WHERE empno=&雇员编号;
 DBMS_OUTPUT.PUT_LINE('EmpNo' || ' ' || 'Ename' || ' '|| 'Job' || ' ' || 'Manager' || ' ' || 'HireDate' ......

SQL参数化

SqlCommand com = new SqlCommand("select * from myuser where username=@UserName and password=@Pwd", con);
           
            com.Parameters.Add(new SqlParameter("@UserN ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号