
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 0.44 KB | hits: 16 | expires: Never
Splitting a string and insert into a database
Line1: 00001, Some name, Address, Email
Line2: 00002..
ID | Name | Address | Email | <-- Columns
000001 | Some name | Some street | @mail | <-- Data inserted
000002 etc.
BULK INSERT Contact
FROM 'c:TestData.csv' -- Full path of the Delimited file
WITH
(
FIELDTERMINATOR = ',', --CSV field delimiter
ROWTERMINATOR = 'n' --Use to shift the control to next row
)