我在查询一张包含1000万数据量的表,sql server的数据库!
用asp.net编写,vb的脚本
现在要对xm字段进行查询,我对xm字段做了索引,但是要实现模糊查询!
用的sql是 "select * from 表名 where xm like '%"& edit1.text &"%' "
语法没有问题.但是查询yang的时候没有问题,但是查询yangkunsan长字符串的时候就出现
time expired . the timeout period elapsed piror to completion of operation or the server is not responding!请求帮助,其他有没有什么好的办法来实现呢!
用asp.net编写,vb的脚本
现在要对xm字段进行查询,我对xm字段做了索引,但是要实现模糊查询!
用的sql是 "select * from 表名 where xm like '%"& edit1.text &"%' "
语法没有问题.但是查询yang的时候没有问题,但是查询yangkunsan长字符串的时候就出现
time expired . the timeout period elapsed piror to completion of operation or the server is not responding!请求帮助,其他有没有什么好的办法来实现呢!
参考:http://community.csdn.net/Expert/topic/3295/3295983.xml?temp=.1425745
我在程序中查询yang没有问题,可以很快得到结果,但是查询yangtaokun等长字符串就会超时,怎么解决呢!查询分析器可以查出来的,没有问题也试过
@TacheCurrentNo char(60)
AS
beginselect select * from 表名 where xm like '%'+@TacheCurrentNo +'%'end
我对sql server 不太熟悉,可能说得不对。
你能不能分开查
先用 "select * from 表名 where xm like '%yang' "建立一个临时表再在这个临时表中"select * from 表名 where 临时表 like 'taokun%' "不知行不行