BCP e SqlBulkCopy

Su suggerimento di Lorenzo, relativamente al mio precedente post, sono andato a studiarmi l'utility da comand prompt bcp, ma mi sono accorto che è analoga alla classe SqlBulkCopy che espone le stesse (o quasi) funzionalità all'interno del framework .NET 2.0 (o superiore) - per tutte le versioni di SQL Server ad esclusione della Compact edition:

Remarks

Microsoft SQL Server includes a popular command-prompt utility named bcp for moving data from one table to another, whether on a single server or between servers. The SqlBulkCopy class lets you write managed code solutions that provide similar functionality. There are other ways to load data into a SQL Server table (INSERT statements, for example), but SqlBulkCopy offers a significant performance advantage over them.

The SqlBulkCopy class can be used to write data only to SQL Server tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable instance or read with a IDataReader instance.

Peccato che al momento non riesco a farla funzionare :-(

Appena ci riesco posto i risultati.

Comunque un grazie di cuore a Lorenzo, sempre così gentile a seguire anche chi come me annaspa in acque mooolto basse (circa mezzo bicchiere!).

Se non altro, visto che mi sento un privilegiato che può studiare senza l'assillo di deadline, milestones, clienti incazzati che aspettano il rilascio di qualche progetto (al masimo il cliente sono io stesso, quindi mooolto accomodante), spero di poter fare qualcosa di utile per la community.

Buon Natale!

posted @ domenica 23 dicembre 2007 17:33

Print

Comments on this entry:

# re: BCP e SqlBulkCopy

Left by Lorenzo Barbieri at 23/12/2007 22:28
Gravatar
Tanti auguri di Buon Natale anche a te!
Comments have been closed on this topic.
«luglio»
domlunmarmergiovensab
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910