Skip to main content
Participant
Dec 11, 2007 3:25 PM UTC
Question

MSSQL Failover and Connection String

Hi,
I am using Coldfusion 8. In CFIDE I saw "Connection String" parameter under Advanced setting for MSSQL Data connection.

I was wondering if we can use it for failover using a connection string like:
"Data Source=server1;FailoverPartner=server2;Initial Catalog=db_name;Uid=db_user;Pwd=db_pass;"

Where server2 is mirrored database.

thanks in advance :)

    This topic is closed to new replies. Start a new post to keep the conversation going.

    5 replies

    Participant
    Dec 11, 2007 3:36 PM UTC
    Hi,

    You have to create a specific dsn to use this feature.

    First create a new ColdFusion datasource of type “Other”.
    Enter the following settings, replacing XXXs with your details;

    CF Data Source Name: XXX

    JDBC URL jdbc:macromedia:sqlserver://ipaddress_server1:1433;databaseName=XXX;
    SelectMethod=direct;sendStringParametersAsUnicode=false;
    MaxPooledStatements=1000;AlternateServers=(ipaddress_server2:1433)

    Driver Class : macromedia.jdbc.MacromediaDriver
    Driver Name: SQL2005
    User Name : XXX
    Password : XXX

    If you use unicode for string (nvar, ntext, ...), you have to change sendStringParametersAsUnicode=false to true

    Enjoy!
    Sébastien
    Translate
    Participant
    Dec 11, 2007 3:43 PM UTC
    Thanks ..that works really cool!
    Translate
    BKBK
    Community Expert
    Community Expert
    Dec 26, 2016 4:47 PM UTC

    Hi @spitfire01, please kindly mark the correct answer. It will surely help someone else in future.

    Translate