本文介绍了超时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 通过Windows预定的 任务界面从命令行执行osql后,返回以下错误:超时已过期 代码在sql中如下: BACKUP数据库DBName为DISK =''D:\ Files \ Backups\DBName.bak''WITH INIT go 备份期间或仅连接到服务器时是否发生超时?它们位于 相同集线器的两台机器之间没有防火墙,并且执行osql的机器安装了SQL 2000,而数据库机器具有SQL 2005. 。 /> 命令行是: 打印时间 osql -b -n -E -S ServerName -i Backup.sql 打印时间 ,输出为: 8:00a 超时已到期 8:00a 任何想法是什么问题?它间歇性地发生,并且在98%b / b 的时间内工作。通常当发生这种情况时,在下一次备份期间它将修复 。After executing osql from the command line via the Windows scheduledtask interface, the following error is returned: "Timeout expired"The code in the sql is as follows:BACKUP Database DBName to DISK=''D:\Files\Backups\DBName.bak'' WITH INITgoIs the timeout happening during the backup or in just connecting to theserver? There is no firewall between the two machines they are on thesame hub, and the machine executing osql has SQL 2000 installed whilethe database machine has SQL 2005.The command line is:print timeosql -b -n -E -S ServerName -i Backup.sqlprint timeand the output is:8:00aTimeout expired8:00aAny ideas what the issue is? It happens intermittently, and works 98%of the time. Typically when this happens, during the next backup itwill be fixed.推荐答案 从消息判断,这是命令超时,但是没有 是有意义的,因为默认情况下OSQL没有命令超时。但是 可能有一些间歇性错误导致OSQL将 默认超时设置为0? (因此ODBC的默认超时为30 秒。) 看到时间的秒数也会很有趣。 /> - Erland Sommarskog,SQL Server MVP, es****@sommarskog.se SQL Server 2005联机丛书 http://www.microsoft.com/technet/pro...ads/books.mspx 适用于SQL Server 2000的联机丛书 http:/ /www.microsoft.com/sql/prodinf...ons/books.mspxJudging from the message, this is a command timeout, but that does notmake sense, as OSQL by default does not have a command timeout. Butmaybe there some intermittent error which causes OSQL to set thedefault timeout to 0? (The default timeout for ODBC as such is 30seconds.)It would have been interesting to see the seconds for the time as well.--Erland Sommarskog, SQL Server MVP, es****@sommarskog.seBooks Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspxBooks Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx 这篇关于超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!