Solved

Linked Servers Between Local SQLExpress 2008 & Remote SQL2008?

Posted on 2010-09-24
3
1,011 Views
Last Modified: 2012-05-10
This code worked linking two local SQLExpress 2005 on two seperate PCs. However, I cannot get connection to work while testing from Local SQLExpress and Interent remote SQL 2008 Server.

I have tcp1433 open.
The following code runs 'Successfully' without errors

Linked Server show locally: select * from master..sysservers

[Code That Worked - Local to Local SQLExpress 2005 From C# App]
Exec sp_addlinkedserver @server = '" + remotePcName + "', @srvproduct = '', @provider = 'SQLNCLI', " +
@" @provstr = 'DRIVER={SQL Server};SERVER=" + remotePcName + @"\SQLEXPRESS;Trusted_Connection=yes;'

[Code 'Attempt' Local SQLExpress 2008 to Remote SQL 2008 From MS Mgt Studio 2008]
Exec sp_addlinkedserver
@server = 'RemoteSql', --friendly name
@srvproduct = '',
@provider = 'SQLNCLI',
@provstr = 'DRIVER={SQL Server};Server=tcp:sql2k801.discountasp.net;Initial Catalog=SQL2008_123456_database1;User ID=mysecretid;Password=mysecretpassword;'

I contacted DiscountASP support (no help), did find linked servers are allowed (kb articles).

Help EE....
0
Comment
Question by:pointeman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Expert Comment

by:MohammedU
ID: 33755794
I believe remote connections are disabled in SQL Express by default...
Make sure you enable remote connections...
check the following blog for how enable...

http://blogs.msdn.com/b/sqlexpress/archive/2005/05/05/415084.aspx
0
 

Author Comment

by:pointeman
ID: 33756515
Untrusted domain errors now.
0
 

Accepted Solution

by:
pointeman earned 0 total points
ID: 33757119
SOLUTION:
Before runing sp_addlinkedserver or doing anything else, perform the following task:
1. Login to SQL Server Management Studio 2008 as 'Administrator' ( Windows Authentication or SA)
2. Go to Securtiy -> Logins: create login using same 'user id' and 'password' as Remote login
3. Assign role 'sysadmin' and default database 'master'
4. Logout and LOGIN as the newly created login user and password
5. Now run sp_addlinkedserver
6. Go to Server Objects -> Linked Servers -> mylinkedservername -> remotedbname -> Tables (All show)
7. Run this query: use master;  Select * From mylinkedservername.master.dbo.sysdatabases (approx 3 rows show)
8. Run this query: Select * From mylinkedservername.remotedbname.dbo.mytablename (returns all rows)
This worked for me, hope I didn't miss anything, details... details...
 
 
 
0

Featured Post

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question