CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    May 2007
    Location
    Egypt
    Posts
    19

    I have 2 SQL Server instances and I have a problem!

    I have 2 SQL Server Instances, SQL Server 2000 and SQL Server 2005 -both are developer editions-.
    If I have the Northwind database attached to both SQL Server Instances and I need to access Northwind in a specific instance. What should I do?

    Take into consideration that I'm using Visual Studio 2005 Team Edition and C#.
    So,
    I need to know how to access the Northwind database in a specific instance like SQL Server 2005.
    What will my connection string be?

  2. #2
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: I have 2 SQL Server instances and I have a problem!


  3. #3
    Join Date
    May 2007
    Location
    Egypt
    Posts
    19

    Re: I have 2 SQL Server instances and I have a problem!

    Thanks very much
    But, that wouldn't help

    I found in www.connectionstring.com that:
    Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;

    I know that all

    But, How can I get {theInstanceName} I tried that many and many times.

    But, Actually, I failed
    Mohammad Elsheimy
    [email protected]
    [email protected]

    Just Like a Magic the magic inside the machine
    http://JustLikeAMagic.Wordpress.com

  4. #4
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: I have 2 SQL Server instances and I have a problem!

    so you don't already know the instance names? If not, you can get them from the registry:

    \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL

  5. #5

    Re: I have 2 SQL Server instances and I have a problem!

    You can also look at the list of services in the Administrative Tools - the instance names will be listed as part of the service (ie, MSSQL$SRV1, etc)

  6. #6
    Join Date
    Dec 2007
    Location
    South Africa
    Posts
    263

    Re: I have 2 SQL Server instances and I have a problem!

    Well i know a Sure way to Find an instance, but its a long way, get a SQL2005 installtion CD, there is a point where it ask you to install the Intance and there is a button that says "Installed Instances" if you click there if wil show you the instances for that Computer, but in most of the case the name of the instance is the name of the Computer. but now can i see the name of your Computer, if your Computer name has some "-", then when you install SQL it will create a default instance and it will remove the special character.

    Hope it Helps

  7. #7
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: I have 2 SQL Server instances and I have a problem!

    Quote Originally Posted by vuyiswam
    Well i know a Sure way to Find an instance, but its a long way, get a SQL2005 installtion CD, there is a point where it ask you to install the Intance and there is a button that says "Installed Instances" if you click there if wil show you the instances for that Computer, but in most of the case the name of the instance is the name of the Computer. but now can i see the name of your Computer, if your Computer name has some "-", then when you install SQL it will create a default instance and it will remove the special character.

    Hope it Helps
    the default instance name for SQL Server are MSSQLSERVER and for SQL Express it's SQLEXPRESS

  8. #8
    Join Date
    May 2007
    Location
    Egypt
    Posts
    19

    Re: I have 2 SQL Server instances and I have a problem!

    Thank you very much I tried that and it works so fine.
    Thanks very much for every one.
    Mohammad Elsheimy
    [email protected]
    [email protected]

    Just Like a Magic the magic inside the machine
    http://JustLikeAMagic.Wordpress.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured