sql server connection string

  • I am trying to determine what is the best login for an application that is connecting to a sql server 2008 r2 database.

    A account has been setup for sql server login that looks like the following statement:

    <connectionStrings>

    <add name="eRPTSampleConnectionString"

    connectionString="Data Source=TEST;Initial Catalog=DEV;User Id=TESTUSER;Password=xxxx"

    providerName="System.Data.SqlClient" />

    </connectionStrings>

    I am wondering if I need to set any of the other properties like:

    1.Integrated Security,

    2. trusted_Connection

    3. Max Pool Size

    4. Min Pool Size

    I am asking this question due to resources still being open when the application finishes executing.

    let me know what you recommend.

  • Integrated security and trusted connection are the same thing. For security reasons it is better to use them instead of hard coding a password into connection string. Min and max can set limits of number of connections in the connection pool. See here: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx

    What do you mean by resources are open? Connections are opened? When application closes connection it is not really closed on sql side, just returned to the pool. But if app do not close the connection it will not be released to the pool and number of conn will grow. You have to find the code that does not close the connection.

    You might be interested in connection lifetime parameter and set min pool size above zero.

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply