none
Invalid Object name '111.111.111.111'.ourdb.dbview

    Question

  • Hi,

    can anyone help throw some light on this one, I can get an ODBC to work perfectly to get information into a spreadsheet from the view of a database table on the remote server. I use the same username and password. There is no VPN in place.

    I want to insert the results into a local table but cannot get the simple query below to work.

    The query results in the above error

    EXEC sp_addlinkedserver '111.111.111.111', N'SQL Server'
    EXEC sp_addlinkedsrvlogin '111.111.111.111', 'false', NULL, 'username', 'password'
    GO

    Select * from [111.111.111.111].remotedb.dbview

    I am not any sort of SQL Expert but am reasonably confident with queries to select, update or create tables etc.

    Thanks in anticipation

    Andrew
    Friday, June 06, 2008 10:59 AM

All replies

  • Which line is giving the error?

     

    Can you use the machine name in place of the IP address?

     

     

    Friday, June 06, 2008 11:11 AM
  • Thank you for your reply

    Select * from [111.111.111.111].remotedb.dbview is the line thatgives the error, I can run all other lines of the code without issue.

    I have just put an entry in the host file so that the name could be resolved as the machine is not otherwise identified on the internet. But the error remain the same other than the ipaddress shown in the error message is now the machine name.

    Also just tested a new ODBC Data Source,
    using the machine name, and that works great.


    Friday, June 06, 2008 1:01 PM
  • OK this is a four part name

    FROM [server].[database].[dbo].[Table]

     

    if you use SSMS ( or on 2000 query analizer) you can get it to script the select for you.

     

    Friday, June 06, 2008 1:05 PM