解析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數據庫教程