2010-03-31 2 views
1
set con2=server.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 

asp를 사용하여이 쿼리를 실행하면 다음 오류가 발생합니다. 이 문제를 해결하는 방법?SQL Server 문제로 인해 제한 시간이 만료되었습니다.

'80040e31'ODBC 드라이버 오류

Microsoft OLE DB 공급자

[마이크로 소프트] [ODBC SQL 서버 드라이버] 제한 시간이

+0

SQL Server Management Studi에서 SQL 문만 실행하면 얼마나 걸리나요? o –

+0

1 분 24 초 – Avinash

답변

1

가 대신 not in를 사용하는 left join를 사용 만료 :

delete from tablename 
left join tablename2 on tablename2.fieldid = tablename.fieldid 
where tablename2.fieldid is null 
관련 문제