declare @i int
set @i=1
while(@i<=10)
begin


INSERT INTO [dbo].[Settlements]
           ([ID]
           ,[Count]
           ,[SettlementDate])
     VALUES
           (

       newid() ,cast( floor(rand()*100) as int) --随机int ,DATEADD(DAY,1,(select top 1 [SettlementDate] from [Settlements] order by [SettlementDate] desc )) --获取表中最大的日期然后加1
      )
set @i=@i+1 end

 

相关文章:

  • 2021-12-17
  • 2021-11-01
  • 2021-09-24
  • 2021-06-06
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-21
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案