有啊,是这样的: ---------------------------- CREATE TRIGGER 基本资料_更改当前年月 ON 基本资料 FOR UPDATE AS set nocount on declare @当前年月 nvarchar(50), @更改后的年月 nvarchar(50), @启用年月 nvarchar(50) select @启用年月=i.启用年月, @当前年月=i.当前年月,@更改后的年月=i.当前年月 from inserted i if update(当前年月) begin if @当前年月<@启用年月 BEGIN RAISERROR ('系统时间设置错误!系统时间小于启用时间:%s!', 16, 1,@启用年月) ROLLBACK TRANSACTION END else begin exec yingshou exec fyingshou end endset nocount off
----------------------------
CREATE TRIGGER 基本资料_更改当前年月
ON 基本资料
FOR UPDATE
AS
set nocount on
declare @当前年月 nvarchar(50),
@更改后的年月 nvarchar(50),
@启用年月 nvarchar(50)
select @启用年月=i.启用年月, @当前年月=i.当前年月,@更改后的年月=i.当前年月 from inserted i
if update(当前年月)
begin
if @当前年月<@启用年月
BEGIN
RAISERROR ('系统时间设置错误!系统时间小于启用时间:%s!', 16, 1,@启用年月)
ROLLBACK TRANSACTION
END
else
begin
exec yingshou
exec fyingshou
end
endset nocount off