SQL批量插入数据的存储过程
SQL #存储过程2012-05-11 09:23
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统计每天的登录次数 2012/05/09
- MySQL各种字段类型取值范围 2012/05/09
- oracle 常用SQL语句之二 2012/05/05
- oracle 常用SQL语句 2012/05/05
- SQL Server 2005 大容量日志恢复 2012/05/05
- mysql家谱表查询某人所有后代 2012/05/04
- 查看oracle锁信息的SQL语句 2012/05/04
- oracle创建表空间 2012/05/04
- LINQ查询基础知识之二 2012/05/03
- LINQ查询基础知识 2012/05/03