展开全部
要想同时插入必须通过线程才能实现 并发,大体代码如下:
public class TestInsert extends Thread{
public void run(){
try {
insert 语句..............
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
for(int i=0;i<100000;i++){
try {
new TestInsert (). start();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
public class TestInsert extends Thread{
public void run(){
try {
insert 语句..............
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
for(int i=0;i<100000;i++){
try {
new TestInsert (). start();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
写个循环 就ok 了
declare @Count int=10000000000---设置你想插入的条数
while @Count>0
begin
insert into users values ('测试',@Count)
set @Count = @Count-1
end
declare @Count int=10000000000---设置你想插入的条数
while @Count>0
begin
insert into users values ('测试',@Count)
set @Count = @Count-1
end
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
写个循环,把要插入的做的循环,或者用批处理
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
create table tb(num int)
insert into tb values(1)
go 100000000
insert into tb values(1)
go 100000000
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2018-07-11
展开全部
CREATE TABLE number
(
number BIGINT
)
;WITH a AS
(
SELECT 0 AS n
UNION ALL
SELECT 0
),
b(n) AS
(
SELECT 1 FROM a,a AS b
)
,
c(n) AS
(
SELECT 1 FROM b,b AS c
),
d(n) AS
(
SELECT 1 FROM c,c AS d
),
e(n) AS
(
SELECT 1 FROM d,d AS e
),
f(n) AS
(
SELECT 1 FROM e,e AS f
)
,g(n) AS (
SELECT ROW_NUMBER() OVER(ORDER BY f.n) FROM f
)
INSERT INTO dbo.number
SELECT n FROM g WHERE n<=100000000
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询