sqlserver分页
现在一般常用的有以下2种方法:
1. select top @pagesize * from table1 where id not in (select top @pagesize*(@page-1) id from table1 order by id) order by id
2. select * from (select top @pagesize * from (select top @pagesize*@page * from table1 order by id) a order by id desc) b order by id
相关文档:
SQLServer中的循环批处理
GO命令后面加一个常量就可以了
下面方法可以用来快速生成一批数据
if (object_id ('t' ) is not null ) drop table t
go
create table t (id int identity (1 , 1 ), name varchar (40 ))
go
insert into t (name ) select newid ()
go 10
select * from t
/*
1 &nbs ......
SQL-Structured Query Language
--(开启SQL服务:net start mssqlserver)
--(在命令行中输入'sqlwb'命令可打开SQL管理器 )
--(如果要执行多条命令中的一条,鼠标选定后再按F5执行)
create database sales --创建一个名为sales的数据库
on
(
name='sales_dat ......
概述:
配置 Web 同步
url: http://technet.microsoft.com/zh-cn/library/ms151810(SQL.90).aspx
若要对复制使用 Web 同步,请执行下列步骤:
配置发布,以允许使用 Web 同步。
配置运行 Microsoft Internet 信息服务 (IIS) 的计算机以同步订阅。支持 IIS 5.0 和 6.0 版。
配置一个或多个订阅以使用 Web 同步。
......
SQL-Structured Query Language
--(开启SQL服务:net start mssqlserver)
--(在命令行中输入'sqlwb'命令可打开SQL管理器 )
--(如果要执行多条命令中的一条,鼠标选定后再按F5执行)
create database sales ......
--(开启SQL服务:net start mssqlserver)
--(在命令行中输入'sqlwb'命令可打开SQL管理器 )
--(如果要执行多条命令中的一条,鼠标选定后再按F5执行)
create database sales & ......