MSSQL随机修改时间

GO

DECLARE @BDate datetime, @EDate datetime
SET @BDate = '20190801'          --上限
SET @EDate = '20190819 23:59:59' --下限

UPDATE [dbo].[Service] SET [Addtime] = DATEADD(second,ABS(CHECKSUM(NEWID()))%DATEDIFF(second,@BDate,@Edate),@BDate)

  

posted @ 2019-08-19 13:48  懒人境界  阅读(279)  评论(0编辑  收藏  举报