基于SQL的分页
select top PageSize * from 表
where 条件 and id not in
(select top PageSize*(CurrentPageIndex-1) id from 表 where 条件 order by 排序条件)
order by 排序条件
《PageSize 是GridView中每页显示的信息条数,PageSize*(CurrentPageIndex-1) 在SQL中不识别,需定义变量来替换》
相关文档:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_convert]') and xtype in (N'FN', N'IF', N'TF'))&n ......
分布式查询
OPENROWSET
从Excel取数据
SELECT * from OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=d:\1.xls',[Sheet1$])
从Oracle取数据
SELECT * from OPENROWSET('MSDAORA.1','NetServiceName ......
很早就不用SQLServer 2005了,今天突然接到个项目,说非用SQLServer不可,没办法,只好把久违的老朋友装上去了,遇到了COM+的目录要求不行的问题,以前这个问题我也没有注意,今天想解决下给大伙看看。
解决的方法其实很简单,如下:
1、开户MSDTC服务:“开始-运行”,输入"cmd"后回车 ......
--该表保存结果
create table c(c1 tinyint, c2 tinyint, c3 tinyint, c4 tinyint, c5 tinyint, c6 tinyint, c7 tinyint, c8 tinyint, c9 tinyint, c10 tinyint, c11 tinyint, c12 tinyint, c13 tinyint, c14 tinyint, c15 tinyint, c16 tinyint, c17 tinyint, c18 tinyint, c19 tinyint, c20 tinyint, c21 tinyint, c22 t ......
一、基础
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、说 ......