[dba-SQLServer] BULK INSERT versus OPENROWSET(BULK...)

Asger Blond ab-mi at post3.tele.dk
Fri Nov 13 17:30:08 CST 2009


Importing flat textfiles to an SQL Server table which is the fastest:

 

BULK INSERT myTable FROM '<textfile-path>'

Or

INSERT myTable SELECT a.* FROM OPENROWSET(BULK '<textfile-filepath>') AS a

 

Eventually using format files (same question):

BULK INSERT myTable FROM '<textfile-filepath>'
WITH(FORMATFILE='<formatfile-path>)

Or

INSERT myTable SELECT a.* FROM OPENROWSET(BULK '<textfile-filepath>',
FORMATFILE='<formatfile-path>') AS a

 

Do you have any experience or documentation hint?

 

TIA

Asger




More information about the dba-SQLServer mailing list