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