解析SQL Server 2000 SP4与数据链接池问题_Mssql数据库教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:解析SQL Server 2008对T-SQL语言的增强
Microsoft SQL Server 2008 对 T-SQL 语言进行了进一步增强。为了让开发人员尽快了解这些变化,我们针对 2007 年 6 月 CTP 版本的 SQL Server 2008 中的 T-SQL 语言的新增功能进行

今天远程连接一台xp sp2上的SQL,报错信息如下:

以下为引用的内容:
  Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  Exception Details: System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
  Source Error:
  Line 2503: cmd.CommandType = CommandType.StoredProcedure;
  Line 2504:
  Line 2505: connection.Open();
  Line 2506: SqlCommandBuilder.DeriveParameters(cmd);
  Line 2507: connection.Close();

但是,我的连接字符串中已经设置了,最大链接池=200,应该是不可能全部被占用的。

当把链接池设置去掉,就报:

以下为引用的内容:
  An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
  Source Error:
  Line 2503: cmd.CommandType = CommandType.StoredProcedure;
  Line 2504:
  Line 2505: connection.Open();
  Line 2506: SqlCommandBuilder.DeriveParameters(cmd);
  Line 2507: connection.Close();

这下子,问题就明朗了,典型的没有打 Sql2000 sp4 的问题,打上sp4问题解决,差点被误导。

分享:解读SQL Server数据库备份的方法
SQL Server数据库备份有两种方式,一种是使用BACKUP DATABASE将数据库文件备份出去,另外一种就是直接拷贝数据库文件mdf和日志文件ldf的方式。下面将主要讨论一下后者的备份与恢复。

来源:模板无忧//所属分类:Mssql数据库教程/更新时间:2009-08-02
相关Mssql数据库教程