MS_SQL模糊查询like和charindex的对比
摘要:like查询效率低下,网上搜了一下替代like查询的方法,都是说用charindex方法,自己对比了一下查询速度test1表中有一千两百多万条数据,我只给ID加了索引先看一下 '%我%'这种模糊查询:declare @q datetimeset @q = getdate()select ID,U_Name,U_Sex,U_Age,U_Address from test1 where U_Name like '%我%'select [like执行花费时间(毫秒)]=datediff(ms,@q,getdate())declare @w datetimeset @w
阅读全文
posted @
2012-11-28 23:01
LitDev
阅读(12887)
推荐(4)
MS-SQL分页not in 方法改进之使用row_number
摘要:上一篇博客对比了not in 和 max\min分页的效率,这次来看看row_number分页效率如何在网上扒了一个row_number的分页存储过程,源地址:http://bbs.csdn.net/topics/300185125,在这里稍加修改,使之更加灵活create proc Proc_TablePage--表名@tablename nvarchar(20),--查询字段@selcolumn nvarchar(1000),--排序字段@sortcolumn nvarchar(255),--每页记录数@pagecount int,--页号@pageindex intasdeclar...
阅读全文
posted @
2012-11-28 22:33
LitDev
阅读(708)
推荐(0)
MS-SQL分页not in 方法改进之使用Max\Min
摘要:先看下表中共有多少条数据:一百二十多万条,呵呵。sql语句:declare @d datetimeset @d = getdate()select top 10 ID,U_Name,U_Age,U_Sex,U_Address from Test1 where ID not in (select top 9990 ID from Test1 order by ID) order by ID select [not in方法升序分页执行花费时间(毫秒)]=datediff(ms,@d,getdate()) declare @s datetimeset @s = getdate()select to
阅读全文
posted @
2012-11-28 22:02
LitDev
阅读(1288)
推荐(0)
SQL查询执行某条SQL语句所花费的时间
摘要:declare @d datetimeset @d = getdate()select top 10 U_Name from Test1 where ID not in (select top 30 ID from Test1 order by ID desc) order by ID descselect [语句执行花费时间(毫秒)]=datediff(ms,@d,getdate()) go
阅读全文
posted @
2012-11-19 18:31
LitDev
阅读(398)
推荐(0)
SQL 循环
摘要:declare @i intset @i = 1while @i<100000beginexec Proc_InsertTest1 '测试使用数据',20,'男','地球村'set @i = @i+1end
阅读全文
posted @
2012-11-19 18:29
LitDev
阅读(198)
推荐(0)
JQuery插件simplemodal-basic弹出层的使用
摘要:simplemodal官方地址:http://www.ericmmartin.com/projects/simplemodal/,下面是我测试的一个简单弹出层,在项目开发中,操作消息提示使用alert始终不好,所以找了这个插件来取代alert,在此将官方源码整理一下下载源码后将basic\js\jquery.simplemodal.js(jquery本身js文件随便拷贝一个就行,我用的是VS10中自带的1.4)、basic\img\basic\x.png和basic\css\basic.css文件拷到项目下文件头部引用:<link href="css/basic.css&quo
阅读全文
posted @
2012-11-07 18:01
LitDev
阅读(3835)
推荐(0)
CFUpdate上传控件的使用
摘要:一同事找的这个控件,觉得挺不错的,到官方(http://www.access2008.cn/)下载源码后稍加修改html页面代码:<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh_cn" lang="zh_cn"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>多文件上传组
阅读全文
posted @
2012-11-06 14:57
LitDev
阅读(4016)
推荐(2)
aspx页面嵌入网页播放器
摘要:简单的一个例子,留着备用:<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="520" height="292" id="FLVPlayer"> <param name="movie" v
阅读全文
posted @
2012-11-05 02:16
LitDev
阅读(1351)
推荐(0)