View Single Post
  #7 (permalink)  
Old 11-12-2007, 09:31 PM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile Re: How to insert data from a csv file into a SQL server database?

Try this query to bulk insert data from a file

syntax:
Quote:
BULK INSERT TableName
FROM 'filepath'
WITH
(
FIELDTERMINATOR = ' |',
ROWTERMINATOR = '|\n'
)
example:
Quote:
BULK INSERT AdventureWorks.Sales.SalesOrderDetail
FROM 'f:\orders\lineitem.tbl'
WITH
(
FIELDTERMINATOR =' |',
ROWTERMINATOR =' |\n'
)
__________________
$enthil
Reply With Quote