SQL KIDS
Friday, September 17, 2010
Bulk insert in sql server
--create table
CREATE
TABLE
CSVTest
(
ID
INT
,
FirstName
VARCHAR
(
40
),
LastName
VARCHAR
(
40
),
BirthDate
SMALLDATETIME
)
--bulk insert
BULK
INSERT
CSVTest
FROM
'C:\test.txt'
WITH
(
FIELDTERMINATOR
=
','
,
ROWTERMINATOR
=
'\n'
)
select
*
from
CSVTest
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment