--?
update tb set 是否可用=0 where 有效日期 <当前日期

解决方案 »

  1.   

    if convert(varchar(10),有效期,120)<convert(varchar(10),getdate(),120)
      begin
        update usertable set 是否可用=0 where userid=.......
      end
      

  2.   

    这个是在数据库里面判断啊!每天都会自己执行一次啊!
    DECLARE  cursor_CooperateNo CURSOR FOR SELECT CooperateID FROM dbo.Customize_CooperateTB

    ---- 打开游标并进行加字段处理 ----
    OPEN cursor_Cooperate  
    FETCH NEXT FROM cursor_CooperateNo INTO @CooperateID
    WHILE @@FETCH_STATUS = 0
    BEGIN
    后面不会写......,
    请赐教
      

  3.   

    不需要用游标的!
    见一楼!
    update tb set 是否可用=0 where 有效日期 <当前日期