Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Remote data Access Case

Author  Topic 

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-06-26 : 15:24:16
I have a script that I run few times a month.
The data i need to access is stored locally in one of a company's servers. I have created a script that collect some info from other remote servers, my script usually runs remotly using Remote desktop and then access windows command to execut a .SQL file.

My situation is : At the run time of my script remotly, I will need to compare some data from the first server with data that's stored in the client databases (remote) using my local machine (Remote desktop). It is complex in away that there will be 3 machine involved. Im thinking to generate text files from my local database manually, load the same data into a the remote servers, and them run the audit from my machine.

Please, any idea, thought, suggestion will be appreciated! this is SQL 2000 :)

Thanks,



--------------------------
Get rich or die trying
--------------------------

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-26 : 15:32:31
I would do this in T-SQL via linked servers. I would not be using files.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-06-26 : 15:50:03
quote:
Originally posted by tkizer

I would do this in T-SQL via linked servers. I would not be using files.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



Thanks for the reply

But, what's the linked server, can you please tell me a little bit more about.

Thanks a lot :).

--------------------------
Get rich or die trying
--------------------------
Go to Top of Page

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-06-27 : 09:07:04
quote:
Originally posted by tkizer

I would do this in T-SQL via linked servers. I would not be using files.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog


Hi,

the remote server I will be connecting to is not in my company's network. I have the address IP, SERVER's name, login, password. would it still possible to setup this linked servers?

Thanks.

--------------------------
Get rich or die trying
--------------------------
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 12:35:13
Yes. Please lookup linked servers in Books Online. Linked servers allow you to query a remote server using the 4-part naming convention.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-06-27 : 12:54:20
quote:
Originally posted by tkizer

Yes. Please lookup linked servers in Books Online. Linked servers allow you to query a remote server using the 4-part naming convention.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



Thanks,

I have advanced a little bit:
EXEC sp_addlinkedserver @server='Servername', @srvproduct='SQLOLEDB',@provider='SQLOLEDB', @datasrc='100.150.180.99'
I succeeded adding this server, I can see it listed when I execute this command:
exec sp_linkedservers

However, when I try select from any tabley using the following, it wont work:
select * from [100.150.180.99].dbname.dbo.tablename

I get this error:
Server: Msg 7202, Level 11, State 2, Line 1
Could not find server '100.150.180.99' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.


Any help will be appreciated.
Thanks,

--------------------------
Get rich or die trying
--------------------------
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 13:19:14
You need to use the value you specified in @server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-06-27 : 13:26:18
quote:
Originally posted by tkizer

You need to use the value you specified in @server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



Yes, that was helpful.
SQL server tries to retrieve data but I think for some security reason, I didnt succeed.
here is what the error said:
Server: Msg 17, Level 16, State 1, Line 1
SQL Server does not exist or access denied.


I usually access this server through Remote Desktop.

Any help please, thanks.


--------------------------
Get rich or die trying
--------------------------
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 13:31:51
Try adding the port number in @datasrc. I am not sure if it supports it there or not. If it doesn't, you'll need to add a client alias on the first server.

IPAddress,PortNumber

Actually before modifying the linked server, try connecting via Enterprise Manager/Query Analyzer using IPAddress,PortNumber.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-06-27 : 14:45:32
quote:
Originally posted by tkizer

Try adding the port number in @datasrc. I am not sure if it supports it there or not. If it doesn't, you'll need to add a client alias on the first server.

IPAddress,PortNumber

Actually before modifying the linked server, try connecting via Enterprise Manager/Query Analyzer using IPAddress,PortNumber.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog


I have added an alia with the same IP address, but EM rejects (failed)
I would add the port number but I think the network configuration is setup to reject this type of connection, even tried pingging on the same address IP address with a TIME OUT.
Again, If I could get through this security layer, it will succeed!!
Do you think login information could be a reason too?
Thanks.

--------------------------
Get rich or die trying
--------------------------
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 14:53:17
If a ping doesn't work, this isn't going to work.

The error is very misleading. It never means a security reason. I wish they'd change the text. They made the error even more confusing in newer versions.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

xhostx
Constraint Violating Yak Guru

277 Posts

Posted - 2012-06-27 : 15:53:16
quote:
Originally posted by tkizer

If a ping doesn't work, this isn't going to work.

The error is very misleading. It never means a security reason. I wish they'd change the text. They made the error even more confusing in newer versions.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



according to my situation this server can only be accessed through REMOTE DESKTOP. do you think they should grant me more privilages?

Thanks Tara.

--------------------------
Get rich or die trying
--------------------------
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-27 : 19:06:49
Well I certainly would demand it, but that's just me.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -