Multiple Instance Connection Question

  • Say that 10 times fast.

    I have the need to recreate a server as a named instance on another server.  Here is the question: if I name the instance the same as the old server will the applications see it as two servers named similiarly?  I know the server name comes before the instance name but I don't want to attempt this without knowing for sure.

    Example:

    SQLTEST

    SQLDEV/SQLTEST

    I believe these would be regarded as two different servers.

  • The name that goes in your connection string is SOMEMACHINNAME\INSTANCENAME;

    I would ask this first: why must you create an additional instance, instead of using the default instance on the other machine? why can you not just restore the database with a different name and connect to the default instance?

    You can install SQL 2000 multiple times on the same machine, and connect to each of the instances you create.

    you do not have to name a different server instance to be similar to another  in order to connect. they can be wildly different, and your applicaiton will not care.

    whether the server is SOMEMACHINENAME or SOMEOTHERMACHINE\INSTANCENAME, your application need to get the connection information from someplace, typically an ini file, dsn, or registry or something.  it would be bad practice to hardcode the server name or database name into the application, which is what i think you are trying to do [servervariable]+"\INSTANCENAME" 

     

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • "it would be bad practice to hardcode the server name or database name into the application, which is what i think you are trying to do"

    Nope.

    Believe me, the reason is not driven from the technical side of things.  I am merely the one who must carry out the orders.

  • if this were an internal only applicaiton, i might agree it would be no big deal to install an extra installation of SQL server, but if this is going to be distributed to a client? you are going to tell them that they need to install an extra instance to support your application? What if they have a cluster? they would not install an additional cluster instance that follows your naming convention, they'd just use the Client Network Utility to make any servers named serverx\instance to go to serverx.

    God knows i know what it is like to receive directives that do not make sense, so i feel your pain, but by simply tweaking your connection string, you can resolve the issue instantly:

    Conn.ConnectionString="Provider=SQLOLEDB;Persist Security Info=False;User ID=webdev;Password=fakepass;Initial Catalog=ctgmvb;Network Library=dbmssocn; Data Source=daisy\instancename;

    Conn2.ConnectionString="Provider=SQLOLEDB;Persist Security Info=False;User ID=webdev;Password=otherserverpass;Initial Catalog=ctgmvb;Network Library=dbmssocn; Data Source=bob;

    Conn3.ConnectionString="Provider=SQLOLEDB;Persist Security Info=False;User ID=webdev;Password=otherserverpass;Initial Catalog=ctgmvb;Network Library=dbmssocn; Data Source=192.168.1.123;

    Your connection string would not care whether Connection2 has  a  naming convention on the SOURCE variable or not; it just connects; the third example is if the WINS server cannot tie a name to an IP, and you need to connect directly by IP; it happens once in a while.

    HTH

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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