Connection string with instance name

  • Hi all

    Ive just recently installed sql2005 for a slow migration from 2000.

    The box is used from numerous websites conecting via TCP/IP. Previously our connection strings were of the form;

    Provider=SQLOLEDB; Data Source=1.1.1.1; Initial Catalog=dbname; User ID=user; Password=password; Language=BRITISH ENGLISH"

    Since the new server has both 2005 and 2000 running (2005 was installed first in this case) the instance of 2000 has been given the name servername/SQL2000.

    I have tried using Data Source=1.1.1.1\SQL2000 and Server=1.1.1.1\SQL2000 neither of which works...just get sever does not exist or access denied errors.

    Any help appreciated..

  • The situation has changed, now you have a SQL server named instance instead of default. Have you tried to create an TCP\IP server alias with the  correct port number of the named instance?

  • No I havent' I have never done that before. I thought that adding the instance name at the end would direct the request through to the right database but apparently not!

    I'll look up the aliases now.

    Incidentally I have also tried running the sql2000 instance on a different port and using server=1.1.1.1\instancename,1434 to no avail.

    It shouldnt be this hard to achieve =)

  • OK I've managed to get it to work now..I still dont fully understand the changes in sql2005 but here goes for the sake of others who might find themselves in the same position.

    SQL2005 by default doesnt listen on TCP only local traffic and named pipes, which might catch you out on first installing it.

    SQL2005 has a defualt port of 1433 same as sql2000 which of course causes problems if you have an installation of sql2000 on the same server because of course both services cant be listening on the same port! Sql2005 takes precendence in my installation but I dont know if thats always the case.

    SQL2005 has an extra service on port 1434 the SQL browser service - I initially set my instance of sql2000 to listen on port 1434 so of course that didnt work either!

    Once I set up the sql2000 instance to listen on an unused port this form of connection string worked ok.

    "Provider=SQLOLEDB; Server=1.1.1.1\instance,port; Initial Catalog=ITBuy; User ID=SilverSurferAccess; Password=G1ll1anD1ane; Language=BRITISH ENGLISH"

    Thanks for the help,

    Rolf

Viewing 4 posts - 1 through 3 (of 3 total)

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