先说下环境:
一台服务器装有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初学者
一台服务器装有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初学者
怎么解决
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
按照这个自己修改下