Invalid Object name ''.ourdb.dbview


  • 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 '', N'SQL Server'
    EXEC sp_addlinkedsrvlogin '', 'false', NULL, 'username', 'password'

    Select * from [].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

    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 [].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