最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用SQL批量插入数据的存储过程
时间:2023-08-15 09:48:01 编辑:袖梨 来源:一聚教程网
用SQL批量插入数据的存储过程,需要的朋友可以参考下。
循环插入:
复制代码代码如下:
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
相关文章
- 千牛网页版登录入口-千牛商家后台官网入口 02-23
- 猫咪网页版官方地址-猫咪网页版一键入口 02-23
- 游咔官网入口-2026最新游咔中文官网登录地址 02-23
- 秀米官网登录入口-秀米图文网页版一键登录 02-23
- 迅雷浏览器手机版下载-迅雷浏览器安卓版2026下载 02-23
- 漫蛙漫画-在线观看入口_漫蛙漫画-网页免费观看入口 02-23