Monday, March 12, 2012

Import data from Excel or text

How do I import data from an Excel or text file ?

There are a couple of different options here:

Move everything to a text file and import using the BCP Utility. You should check out the following topics in Books Online:|||

This also works if the destination table is already created :

BULK INSERT database.dbo.Table

FROM 'C:\myFile.csv'
WITH
(
FIELDTERMINATOR = ';',
ROWTERMINATOR = '\n'
);

Best regards.

No comments:

Post a Comment