Reputation: 3181
I have text files which contain one word per line, and I would like to add this content to a column in my table, the column type is Varchar, how can I accomplish that?
Upvotes: 1
Views: 7504
Reputation: 2845
You can also use import wizard provided in the management studio. You can check this link for your reference.
Upvotes: 0
Reputation: 837946
You can treat your file as a special case of CSV - it's a CSV file with only one column.
See this article for how to bulk insert from a CSV file.
BULK
INSERT CSVTest
FROM 'c:\csvtest.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
Upvotes: 2