先说下环境:
一台服务器装有SQL 2000跟2005
2000的数据库命名:B1,2005的数据库B2
B1中有表1中的字段A1、A2、A3...
B2中有表2中的字段A01、A02、A03...先我想,B1的表1发生新记录,B2中的表2字段也随着A01的值=A1值,A02的值=A2,
我应如何操作?SQL SERVER初学者

解决方案 »

  1.   

    SQL SERVER初学者不懂,有代码吗?
      

  2.   

    先建link server连接2个实例,然后用update触发器自动更新..
      

  3.   

    update触发器自动更新,这个如何写?新人
      

  4.   

    http://bbs.csdn.net/topics/390428294?page=1#post-394226149 
    怎么解决
      

  5.   

    create     TRIGGER T_INSERT_Storage_OutRecord
    ON  dbo.Storage_OutRecord
    FOR INSERT 
    AS BEGIN TRANSACTION 
    --强制执行下列语句,保证业务规则 
     declare @Barcode varchar(44)
     declare @Quantity numeric(9,2)
     
     declare @employeeid varchar(30)
     declare @opertime datetime
     if  exists (select * from Record where Barcode  IN (SELECT Barcode from INSERTED))
     begin
      select @Barcode=Barcode,@Quantity=Quantity,@employeeid=employeeid,@opertime=StorageoutTime from INSERTED
      update Record set Quantity=Quantity-@Quantity,employeeid=@employeeid,opertime=@opertime where Barcode=@Barcode end  COMMIT TRANSACTIONGO
    按照这个自己修改下