Skip to main content
Participant
December 11, 2007
Question

MSSQL Failover and Connection String

  • December 11, 2007
  • 1 reply
  • 3055 views
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 has been closed for replies.

    1 reply

    Participant
    December 11, 2007
    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
    Participant
    December 11, 2007
    Thanks ..that works really cool!
    BKBK
    Community Expert
    Community Expert
    December 26, 2016

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