开发者

Timeout expired in sql server problem

开发者 https://www.devze.com 2022-12-25 09:02 出处:网络
set con2=s开发者_StackOverflow社区erver.CreateObject(\"ADODB.Connection\") con2.ConnectionTimeout =1200
set con2=s开发者_StackOverflow社区erver.CreateObject("ADODB.Connection")
con2.ConnectionTimeout =1200
con2.open "Driver={SQL Server};server=111.111.111.11;user id=xx;pwd=xxx;Database=xxx"
con2.execute("DELETE FROM tablename WHERE fieldid NOT IN(SELECT fieldid FROM tablename2)")
con2.close
set con2=nothing

when i running this query using asp the following error occured. How to solve this issue?

Microsoft OLE DB Provider for ODBC Drivers error '80040e31'

[Microsoft][ODBC SQL Server Driver]Timeout expired


Instead of using a not in, use a left join:

delete from tablename
left join tablename2 on tablename2.fieldid = tablename.fieldid
where tablename2.fieldid is null
0

精彩评论

暂无评论...
验证码 换一张
取 消