CREATE trigger daily_customer on daily for insert
as begin
update customer set now_state = inserted.now_state from customer join inserted on user_name = inserted.user_name
end
as begin
update customer set now_state = inserted.now_state from customer join inserted on user_name = inserted.user_name
end
解决方案 »
- 如何编写视图以存储天数段查找数据
- exec基础问题
- 探讨下SQL关于select操作的执行规则,以优化查询的速度
- 高手進!問一分頁加篩選加排序的sql!
- 这个动态SQL语句要怎么执行呢?有参数的
- 几个很基础的问题.
- 事务日志错误(局域网)
- 表A中表N条记录,表B中有300条记录,怎么将表A中Prnum字段值与表B中Prnum字段值不同的记录插入表B
- 求DX一个问题:SQL Server只能用 WINDOWS身份验证,SQL Server 身份验证登陆不了.
- 請問在.net開發環境中如何調試 Sql Server's Stored Procedure?
- 考勤统计的问题
- SQL2005 varchar(max)
as update customer
set now_state= a.now_state
from inserted a
where user_name=a.user_name
as begin
update customer set now_state = inserted.now_state from customer join inserted on customer.user_name = inserted.user_name
end
as begin --这里不用begin ... end封装
Declare @now_state varchar, @user_name varchar --这个地方定义varchar的时候没有加长度
select @now_state=now_state,@user_name=user_name from inserted
update customer set now_state=@now_state where user_name=@user_name
end