Friday, March 9, 2012

problem creating view on table from linked server DB using IP addr

Hello,
I can create a view on a table from a named linked server database.
select * from server1.RemoteDB.dbo.Table1
But I am having a problem creating a view on a table from a non-named linked
server that is just using the IP address of the server. Example:
Select * from [56.19.175.167].RemoteDB.dbo.Table1
When I run the view (in design mode) the square brackets get moved around
like this:
Select * from [56].[19.175.167.RemoteDB].dbo.Table1
The error message says it cannot find the server [56] and to re-run
sp_addlinkedserver. Could someone share the correct syntax for using the I
P
address as the server name?
Thanks,
Rich> When I run the view (in design mode)
STOP DOING THAT!
Create your view in Query Analyzer, and run the view in Query Analyzer.
Enterprise Mangler's tool for this is quite crippled and this is not the
only problem you'll encounter. Try using a CASE expression in your query,
for one.
A|||Just a few more details:
I am already aliasing the remote table
Select * from [56.19.175.167].RemoteDB.dbo.Table1 tblx
and
for the linked server that I can create a view on - that server resides on
the same server computer as the server I am working from.
The server I am having a problem with is a remote server which resides 3000
miles away from my local server. Does this make a difference?
"Rich" wrote:

> Hello,
> I can create a view on a table from a named linked server database.
> select * from server1.RemoteDB.dbo.Table1
> But I am having a problem creating a view on a table from a non-named link
ed
> server that is just using the IP address of the server. Example:
> Select * from [56.19.175.167].RemoteDB.dbo.Table1
> When I run the view (in design mode) the square brackets get moved around
> like this:
> Select * from [56].[19.175.167.RemoteDB].dbo.Table1
> The error message says it cannot find the server [56] and to re-run
> sp_addlinkedserver. Could someone share the correct syntax for using the
IP
> address as the server name?
> Thanks,
> Rich
>|||> Select * from [56.19.175.167].RemoteDB.dbo.Table1 tblx
Another thing to reduce the complexity here, of having IP addresses
hard-coded into your query, is to create a simply-named alias using Client
Network Utility, and then refer to the alias instead of the IP address. Not
that this makes it okay to use the view designer, but I think it is a better
approach overall. In addition to alleviating problems with 4-dot naming, it
also makes it much easier to update the system should that IP address
change - you just change the alias definition instead of all the places you
manually referred to it in code.

No comments:

Post a Comment