| |

VerySource

 Forgot password?
 Register
Search
View: 704|Reply: 4

How to insert hundreds of pieces of data into the database

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-22 23:20:02
| Show all posts |Read mode
How do you prawn insert millions of data into the database, speed up, thank you
Reply

Use magic Report

0

Threads

93

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 United States

Post time: 2020-2-5 09:00:01
| Show all posts
create table ta (id int)
go
declare @i int, @j int
select @ i = 1, @ j = 100
while @i!> @ j
begin
insert ta select @i
set @ i = @ i + 1
end
select * from ta
Reply

Use magic Report

0

Threads

93

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 China

Post time: 2020-2-5 10:00:01
| Show all posts
create table ta (id int)
go
declare @i int, @j int
select @ i = 1, @ j = 1000000--define one million
while @i!> @ j
begin
insert ta select @i
set @ i = @ i + 1
end
select * from ta
Reply

Use magic Report

0

Threads

93

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 China

Post time: 2020-2-5 13:30:02
| Show all posts
create table ta (name1, name varchar (100))
set rowcount 1000000
insert ta
select a.name from sysobjects a, syscolumns b
set rowcount 0
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-3-18 16:00:01
| Show all posts
Thank you
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list