Create a trigger in table A of database A and insert data into table A to transfer data to a table in B database

Source: Internet
Author: User
EXEC sp_addlinkedserver@server= ' cqq ',--the server alias being accessed (habitually using the target server IP directly, or taking an individual name such as: JOY) @srvproduct = ' ms ', @provider = ' SQLOLEDB ', @datasrc = ' 172.18.5.9 '--to access the server exec sp_addlinkedsrvlogin@rmtsrvname= ' cqq ',--the server alias being accessed (if the above sp_ Addlinkedserver Use alias Joy, this is also joy) @useself = ' false ', @locallogin =null, @rmtuser = ' sa ',--account @rmtpassword= ' sa '--Password set Ansi_nulls ongoset quoted_identifier ongocreate TRIGGER [dbo]. [Insert_abvod_a]   On  [dbo].[ A] after   Insertas Begininsert into CQQ. B.dbo.aselect * from Inserteddelete from A to insertedendgoexec sp_dropserver ' cqq ', ' droplogins '



Create a trigger in table A of database A and insert data into table A to transfer data to a table in B database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.