不写触发器,又想实现所谓的自动功能就是用存储过程好了。
create proc au_instert @id int(20),@time varchar(20)
as
insert into 表2
select @id,(select 入库数量 from 表1 where 入库版卡号=@id),@time
go
CREATE TABLE doc_exc ( column_a INT)
GO
ALTER TABLE doc_exc ADD column_b VARCHAR(20) NULL
CONSTRAINT exb_unique UNIQUE
GO
EXEC sp_help doc_exc
GO
DROP TABLE doc_exc
GO