用SQL批量插入数据的代码
时间:2024-01-15 04:49:30
DECLARE @MyCounter INT
SET @MyCounter = 0 /*设置变量*/
WHILE (@MyCounter < 2) /*设置循环次数*/
BEGIN
WAITFOR DELAY '000:00:10' /*延迟时间10秒*/
INSERT INTO time_by_day
(time_id, the_date, the_year, month_of_year, quarter, day_of_month)
SELECT TOP 1 time_id + 1 AS time_id, the_date + 1 AS the_date, YEAR(the_date + 1)
AS the_year, MONTH(the_date + 1) AS month_of_year, { fn QUARTER(the_date + 1)
} AS quarter, DAY(the_date + 1) AS day_of_month
FROM time_by_day
ORDER BY time_id DESC
SET @MyCounter = @MyCounter + 1
END
标签:SQL,批量插入
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python格式化输出字符串方法小结【%与format】
2023-01-06 00:01:50
PyTorch device与cuda.device用法介绍
2022-07-26 23:49:10
Python使用淘宝API查询IP归属地功能分享
2021-02-11 20:37:29
Python微服务开发之使用FastAPI构建高效API
2022-04-20 21:51:13
![](https://img.aspxhome.com/file/2023/2/134902_0s.webp)
进一步了解Python中的XML 工具
2022-06-25 21:49:17
python numpy 按行归一化的实例
2023-04-29 09:14:53
DreamWeaver制作会移动的广告条
2008-02-03 11:34:00
JQuery判断radio(单选框)是否选中和获取选中值方法总结
2024-04-19 10:24:11
JavaScript队列的应用实例详解【经典数据结构】
2024-04-16 09:53:13
python模拟登录百度贴吧(百度贴吧登录)实例
2023-11-20 14:30:56
![](https://img.aspxhome.com/file/2023/4/63614_0s.jpg)
Python实现迷宫自动寻路实例
2021-12-22 10:00:44
![](https://img.aspxhome.com/file/2023/0/133310_0s.jpg)
如何在python中判断变量的类型
2022-05-03 03:35:06
![](https://img.aspxhome.com/file/2023/9/84109_0s.png)
vuex中数据持久化插件vuex-persistedstate使用详解
2024-04-26 17:41:54
![](https://img.aspxhome.com/file/2023/2/133122_0s.png)
django 模版关闭转义方式
2023-07-18 15:23:03
![](https://img.aspxhome.com/file/2023/1/70201_0s.jpg)
Python中Matplotlib的点、线形状、颜色以及绘制散点图
2023-06-11 00:32:26
![](https://img.aspxhome.com/file/2023/5/78685_0s.jpg)
深入浅析同源策略和跨域访问
2024-04-28 09:49:02
快速解决jupyter notebook启动需要密码的问题
2023-09-27 23:56:49
![](https://img.aspxhome.com/file/2023/9/97039_0s.jpg)
使用requests库制作Python爬虫
2023-08-17 21:43:23
PyTorch+LSTM实现单变量时间序列预测
2023-09-23 02:58:05
![](https://img.aspxhome.com/file/2023/5/92445_0s.jpg)
js模拟实现Array的sort方法
2024-04-10 11:03:22