Wednesday, March 21, 2012

How Can I add a linked server with IP address only(Not server name)

Hi, there,

I am try to add a linked server to one of my server. the problem is, those two servers are not on the same network. I have to put in IP address as linked server name. I added the server OK, but when I do the query, I have to put the server name in the query, which caused error.

say the IP address of the linked server is 64.253.133.100
the query looks like,

select * from 64.253.133.100.databasename.dbo.tablename

Is there any way I can add the linked server with IP address at all?

Thank you

Jack

You can keep the linked server name different from the actual server name (which you are refering to as IP). Use this
EXEC master.dbo.sp_addlinkedserver @.server = N'LINKEDSERVERNAME', @.srvproduct=N'SQLNCLI', @.provider=N'SQLNCLI', @.datasrc=N'64.253.133.100'
Use master.dbo.sp_addlinkedsrvlogin to set the appropriate login/password.

Thanks,
Kuntal

|||Kuntal

Thank you so much. It worked.

Jack

No comments:

Post a Comment