while循环
1 declare @i int 2 set @i=0 3 while @i<100 4 begin 5 INSERT INTO table (id,name) values (1,'name') 6 set @i = @i+1 7 end
随机数
1 select Floor(@end*RAND(CAST(NEWID() AS BINARY(16))))+@start
日期
1 -- 日期转成unix时间戳 2 select datediff(ss, '1970-01-01 00:00:00', getdate()) 3 4 -- unix时间戳 转成日期 5 DATEADD (ss ,1356998400 % 60 ,DATEADD(mi,1356998400 / 60,'1970-01-01 00:00:00'))