Click to See Complete Forum and Search --> : I have 2 SQL Server instances and I have a problem!
Geming Leader
September 8th, 2008, 02:19 AM
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?
eclipsed4utoo
September 8th, 2008, 07:45 AM
http://www.connectionstrings.com/
Geming Leader
September 8th, 2008, 07:51 AM
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
eclipsed4utoo
September 8th, 2008, 11:07 AM
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
mmetzger
September 8th, 2008, 07:21 PM
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)
vuyiswam
September 9th, 2008, 04:35 PM
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
eclipsed4utoo
September 10th, 2008, 08:15 AM
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
Geming Leader
September 11th, 2008, 02:34 AM
Thank you very much I tried that and it works so fine.
Thanks very much for every one.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.