| |

VerySource

 Forgot password?
 Register
Search
View: 1336|Reply: 9

Bulk data write

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-21 22:30:01
| Show all posts |Read mode
In a table, more than 100,000 pieces of data are written at one time. What method can be faster. So slow now
Reply

Use magic Report

0

Threads

66

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-5-2 12:45:01
| Show all posts
insert into table select a, b union all select b, c ...
Reply

Use magic Report

2

Threads

18

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-5-2 17:15:01
| Show all posts
BULK INSERT
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-5-2 17:45:01
| Show all posts
insert tbName (colName) select top 100000 1 from syscolumns, sysobjects
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-5-2 18:00:01
| Show all posts
select top 100000 id = identity (int, 1,1) into #t from syscolumns a, sysobjects b
Reply

Use magic Report

0

Threads

114

Posts

69.00

Credits

Newbie

Rank: 1

Credits
69.00

 China

Post time: 2020-5-2 18:15:01
| Show all posts
Use JOB ~
Reply

Use magic Report

2

Threads

18

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-5-2 22:45:01
| Show all posts
The bcp command line prompt utility copies Microsoft® SQL Server&# 8482; data to or from a data file. This utility is most commonly used to transfer large amounts of data from other programs (usually another database management system (DBMS)) to SQL Server tables. The data is first exported from the source program to a data file, and then bcp is used to import the data from the data file to the SQL Server table. In addition, bcp can also be used to transfer data from SQL Server tables to data files for use by other programs. For example, you can copy data from an instance of SQL Server to a data file. Other programs can import data from this data file.



Note The bcp utility is written using the ODBC Bulk Copy Application Program Interface (API). The earlier version of the bcp utility was written using the DB-Library bulk copy API.


Using the BULK INSERT statement, you can also transfer data from data files to SQL Server tables. However, the BULK INSERT statement cannot bulk copy data from the SQL Server instance to the data file. The BULK INSERT statement enables you to use Transact-SQL statements instead of the command prompt to implement the functionality of the bcp utility, and bulk copy data to SQL Server instances.

You can also use the bulk copy API to bulk copy data between SQL Server and data files by writing programs. The bulk copy API can be used in applications based on ODBC, OLE DB, SQL-DMO and DB-Library.
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-5-3 00:00:01
| Show all posts
-Add one more table

insert tbName (colName) select top 100000 1 from syscolumns a, sysobjects b, syscolumns c
Reply

Use magic Report

0

Threads

126

Posts

73.00

Credits

Newbie

Rank: 1

Credits
73.00

 Invalid IP Address

Post time: 2020-5-3 14:30:01
| Show all posts
BCP should be faster
Reply

Use magic Report

0

Threads

126

Posts

73.00

Credits

Newbie

Rank: 1

Credits
73.00

 China

Post time: 2020-5-3 16:00:01
| Show all posts
At the command line, enter BCP / ?, you can see the command format
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