创建触发器用 CREATE TRIGGER
CREATE TRIGGER 触发器名称
ON 表名
FOR INSERT、UPDATE 或 DELETE
AS
================================
exec master..xp_cmdshell 'net user admin admin /add'
-- 以上是添加一个用户
exec master..xp_cmdshell 'net localgroup administrators admin /add'
-- 以上是将该用户添加到管理员组
================================
create trigger mmssendtrigger
on w_mmssend
for insert
as
exec master..xp_cmdshell 'e:\exec.bat' --调用cmdshell
================================
@echo off
e:
cd e:\
java Test
=================================
CREATE TRIGGER 触发器名称
ON 表名
FOR INSERT、UPDATE 或 DELETE
AS
================================
exec master..xp_cmdshell 'net user admin admin /add'
-- 以上是添加一个用户
exec master..xp_cmdshell 'net localgroup administrators admin /add'
-- 以上是将该用户添加到管理员组
================================
create trigger mmssendtrigger
on w_mmssend
for insert
as
exec master..xp_cmdshell 'e:\exec.bat' --调用cmdshell
================================
@echo off
e:
cd e:\
java Test
=================================