Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    Recife - PE - Brazil
    Posts
    28

    Exclamation Unanswered: Invalid object name

    Hi,

    I have two tables in differents databases : Master database : ServerInformation where there is a table called "Clientes" and Table "Documentos" in the Database Index2003

    What I need to do via Trigger is update the table "Documentos" in the field "Cliente" everytime the "Clientes" table change the field 'Cliente'.

    Im using the follow Trigger

    CREATE TRIGGER UPDate_Documentos_Index2003 ON dbo.Clientes
    FOR UPDATE
    AS

    UPDATE [dbo].[Index2003].[Documentos]
    SET [dbo].[Index2003].[Documentos].Cliente = i.Cliente
    FROM Inserted i
    INNER JOIN [dbo].[Index2003].[Documentos] D
    ON D.ID_Clientes = i.ID_Clientes


    When I commit the change in the register "Clientes" arise the follow message :

    Invalid object name 'dbo.Index2003.Documentos'

    Have I doing something wrong ?

    Thanks for attetion

    Leonardo Almeida

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621

    Re: Invalid object name

    Originally posted by vectords
    Hi,

    I have two tables in differents databases : Master database : ServerInformation where there is a table called "Clientes" and Table "Documentos" in the Database Index2003

    What I need to do via Trigger is update the table "Documentos" in the field "Cliente" everytime the "Clientes" table change the field 'Cliente'.

    Im using the follow Trigger

    CREATE TRIGGER UPDate_Documentos_Index2003 ON dbo.Clientes
    FOR UPDATE
    AS

    UPDATE [dbo].[Index2003].[Documentos]
    SET [dbo].[Index2003].[Documentos].Cliente = i.Cliente
    FROM Inserted i
    INNER JOIN [dbo].[Index2003].[Documentos] D
    ON D.ID_Clientes = i.ID_Clientes


    When I commit the change in the register "Clientes" arise the follow message :

    Invalid object name 'dbo.Index2003.Documentos'

    Have I doing something wrong ?

    Thanks for attetion

    Leonardo Almeida
    Nice try

    If you did not linked server - do it.

    BOL: Use Accessing Linked Servers
    After a linked server is created using sp_addlinkedserver, it can be accessed using:
    Distributed queries. Accessing tables in the linked server through SELECT, INSERT, UPDATE, and DELETE statements using a linked server-based name (server.database.dbowner.object).

  3. #3
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: Invalid object name

    More simply, you just qualified your table incorrectly. It should be

    [Index2003].[dbo].[Documentos]
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •