How to use Trigger to update the data from linked server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pizzab
    New Member
    • Jun 2010
    • 3

    #1

    How to use Trigger to update the data from linked server

    I am using SQL server 2008 express on Windows Server 2003. I have a linked database. The linked server is using Sql server 2005 on Windows server 2000.

    I want to use a trigger on the sql server 2008 express to update my data in the database of Windows Server 2003 if there is any data change on the linked database.

    Your help will be appreciated.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    What do you have so far?


    ~~ CK

    Comment

    • pizzab
      New Member
      • Jun 2010
      • 3

      #3
      Originally posted by ck9663
      What do you have so far?


      ~~ CK
      Thanks for your reply. I have a SQL server 2008 database on Windows Server 2003. The database data is actually from a link server by using SQL insert statement. I want to make a trigger that when there is some update on the linked server, the data on my SQL server 2008 database will be update. I am a newbie on trigger. Thanks for your help in advance.

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Have you tried replication? But if you really want it that way, add a link server first then create your trigger updating the table on the linked server. Just watch for an update involving a large number of record, it might cause locks on some other processes. Also, you might have problem enclosing the entire batch in a transaction since it's on another server.

        Good Luck!!!

        ~~ CK

        Comment

        • pizzab
          New Member
          • Jun 2010
          • 3

          #5
          Originally posted by ck9663
          Have you tried replication? But if you really want it that way, add a link server first then create your trigger updating the table on the linked server. Just watch for an update involving a large number of record, it might cause locks on some other processes. Also, you might have problem enclosing the entire batch in a transaction since it's on another server.

          Good Luck!!!

          ~~ CK
          Thanks ck9663 for your reply,

          For replication, is it using sql to do so or using sql server 2008 express interface. I am a newbie. If possible, could you please indicate me with related web link. Once again, thanks for your help.

          Regards,
          pizzab

          Comment

          Working...