SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Linked Server problem~!


Linked Server problem~!

Author
Message
Nisha-475382
Nisha-475382
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3185 Visits: 364
Folks, I need to create a linked server between two SQL servers.. one is on my local machine, other one is at a remote location. I've connected to both servers on SSMS, i need to create the linked server on the remote server in order to be able to import some data from local to remote.

The following is my add linked server query.

EXEC sp_addlinkedserver
@server = 'D_Link',
@provider = 'SQLNCLI',
@srvproduct = '',
@datasrc='xxx.xxx.x.xx\A31',--ip address\instance name
@provstr='SERVER=xxx.xxx.x.xx\A31',
@catalog='DService' -- DB name



Could you tell me what I'm doing wrong as I'm getting an error on executing :

select * from D_Link.DService.dbo.device



edit:
The error says:

[OLE/DB provider returned message: Login timeout expired]
[OLE/DB provider returned message: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.]
[OLE/DB provider returned message: SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. ]
OLE DB error trace [OLE/DB Provider 'SQLNCLI' IDBInitialize::Initialize returned 0x80004005: ].
Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'SQLNCLI' reported an error.

Nisha-475382
Nisha-475382
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3185 Visits: 364
Ok I figured out what my problem was!

I mentioned only the IP Address rather than IP\instance name
and then I did the following:
LinkedServer>> Properties>> Server Options >> Use Remote Collation >> FALSE It is set to True by default.

Now, what I need to know is, when I try to exec sp_addlinkedserver,
I get an error that says :
The user does not have permission to perform this action.

What permissions would I need for this and how can I set it?
Nisha-475382
Nisha-475382
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3185 Visits: 364
Should I be posting this in 'administration' now?
Please help, people!

I need to send a request to the client to grant me necessary permissions. So what exactly is it that I need to ask for?
kgunnarsson
kgunnarsson
SSC Eights!
SSC Eights! (978 reputation)SSC Eights! (978 reputation)SSC Eights! (978 reputation)SSC Eights! (978 reputation)SSC Eights! (978 reputation)SSC Eights! (978 reputation)SSC Eights! (978 reputation)SSC Eights! (978 reputation)

Group: General Forum Members
Points: 978 Visits: 275
you will need to have execute rights to the sp_addlinkedserver procedure.

kgunnarsson
Mcitp Database Developer.
Nisha-475382
Nisha-475382
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3185 Visits: 364
I tried using openrowset. Do I need permissions for that too?

I executed the following query on the remote server with IP of my local server in place of xxx.xxx.x.xx :


SELECT a.*
FROM OPENROWSET('SQLOLEDB','Server=xxx.xxx.x.xx;Trusted_Connection=yes;',
'SELECT *
FROM DService.dbo.device') AS a;



I get the following error message:

Msg 7416, Level 16, State 2, Line 1
Access to the remote server is denied because no login-mapping exists
.

Really... what is it I'm missing out on?
I'm going nuts here!
Nisha-475382
Nisha-475382
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3185 Visits: 364

SELECT a.*
FROM OPENROWSET('SQLOLEDB','xxx.xxx.x.xx';'sa';'sa',
'SELECT *
FROM DService.dbo.device') AS a;



Error:

Msg 17, Level 16, State 1, Line 2
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.


What does this mean now?
ALZDBA
ALZDBA
SSC Guru
SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)

Group: General Forum Members
Points: 120169 Visits: 9343
did you enable "open rowset" on both instances ?

Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Nisha-475382
Nisha-475382
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3185 Visits: 364
On my local server, yes.. but on the remote one, I wouldn't be able to check, right?

EDIT:

I found some info here:


http://www.alagad.com/go/blog-entry/one-solution-to-this-error-sql-server-does-not-exist-or-access-denied


But this seems to be a resolution for SQL Server 2000. What about 2005??
By the way, my local machine is 2005, remote 2000.
ALZDBA
ALZDBA
SSC Guru
SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)SSC Guru (120K reputation)

Group: General Forum Members
Points: 120169 Visits: 9343
y the way, my local machine is 2005, remote 2000.

That's another story Doze

Did you apply http://support.microsoft.com/default.aspx?scid=kb;en-us;906954 at the sql2000 instance ?

Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Nisha-475382
Nisha-475382
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3185 Visits: 364
Ok.. forget I even mentioned one is on 2000 and the other on 2005.
I can have both on 2000, that's barely even an issue.
I executed instcat.sql.... no difference.

Let me get this clear first....

1) Remote server (say in FL,USA) is on SQL2k

2) Local Server (say in CA,USA) is on SQL2k

3) I need to import data from Local Server into the corresponding Remote Server tables.

4) When i try executing sp_addlinkedserver on remote server, it says I have no permission to perform this action.

5) So I tried using openrowset on the remote server, as mentioned in the above post. And now it says the Server (Local Server IP in the query) does not exist or Access is denied.

6) I'm so sure there's something I'm doing wrong but I juts can't put a finger on it!

What am I expected to do if I need to perform this operation and have no way of accessing the Remote macine except through SSMS/Enterprise Manager.. whichever.

I'm lost and confused now.

EDIT:

When I execute the openrowset on local server with remote server IP, I can query the reqd. tables... WHAT IS HEPPENING? I'm tearing my hair out!!!!

SELECT a.*
FROM OPENROWSET('SQLOLEDB','xxx.xxx.xx.x';'da';'4da2',
'SELECT *
FROM dcorpdb.dbo.tbl_Designation') AS a;
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search