22,209
社区成员
发帖
与我相关
我的任务
分享
就是要到了用户设置的某一个时间值后再执行 某些sql语句
但是每个值应该跟客户挂钩吧。不可能随便什么客户都能改别人的时间
if getdate()>=(select [时间类型字段] from [表名]) begin [执行sql更新语句] end
if exists(select 1 from tb where getdate()>时间字段) update ....
update里面加个where条件判断就可以了
if getdate()>=(select [时间类型字段] from [表名])
begin
[执行sql更新语句]
end