We help IT Professionals succeed at work.

How to create a linked server to a named instance?

artena
artena asked
on
1,135 Views
Last Modified: 2008-07-22
Hi..

I am trying to create a link server from SQL Server 2005-A to another SQL Server 2005-B which is on named instance.e.g HPSR080001\Artenaprod. I am able to create a link from SQL Server A but I am unable to get the option 'test connection'. It does not come up with any error and I am not sure if the connection is been made. I think NOT.

I have tried using both options which are SQL Server and Other Data Source but no joy. The settings which I have put in for the Data Source are:

Provider: OLE DB Provider
Product Name:HPSR080001
Data Source:HPSR080001/Artenaprod
Provider string:
Catalog:Artena

As for the security, I am using the option 'be made using this security context' whereby I have put in the SQL Server B 'sa' username and 'password'.

I have tried on my own and I am able to make a test connection if both of my SQL server is on default instance.

Long story short, how do I make a connection for a named instance?

Please help.

Thank you.
Artena
Comment
Watch Question

Jagdish DevakuSr DB Architect

Commented:
hi,

To create the linked server run the following scripts...

exec sp_addlinkedserver 'remoteip\instance' -- accept defaults for all other params

exec sp_addlinkedsrvlogin @rmtsrvname='remoteip\instance', @useself=false, @locallogin=null,
@rmtuser='username', @rmtpassword='password'


If you face any issues, please let me know...
Jagdish DevakuSr DB Architect

Commented:
before running the above scripts, delete linked servers created for same instance.
Jagdish DevakuSr DB Architect

Commented:
Please ensure that SQL Sever 2005-B is enabled with remote connections. If not enable them by following method:

1. Go to Surface area COnfiguration from Start - Programs - Microsoft SQL 2005 - Configuration Tools - SQL Server Surface Area Configuration

2. Select Surface area configuration for services and connections

3. Select Remote Connections from Database Engine dropdown list and enable 'Local and Remote Connection'

Author

Commented:
Hi Jagdish.

Thank you for your suggestions. I will try that out and will let you know. I have already checked the remote connection setting for SQL Server B and it is set to allow both local and remote connection.

What makes it bizzare is I could make the linked server from SQL Server B to SQL Server A without any problems. From there I could see the option for 'test connection' and it makes a successfull connection to SQL Server A.

Do you know what is the reason why I cant do it through management studios and instead have to run transact sql commands?

Thanks
Artena
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.