Larry Brister
asked on
Import CSV file
I would like to import a csv file into a table with a stored procedure.
Let's say that the file is located at
c:\foldername\web.csv
I want * inserted into tblWebs
Let's say that the file is located at
c:\foldername\web.csv
I want * inserted into tblWebs
assuming c: is the local drive of the database server
ASKER
gbshahaq:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near ','.
Msg 105, Level 15, State 1, Line 4
Unclosed quotation mark after the character string ')
EXEC(@bulk_cmd)
'.
that's a bit bad - copied that from BOL!!
try this:
DECLARE @bulk_cmd varchar(1000)
SET @bulk_cmd = 'BULK INSERT tblWebs
FROM ''c:\foldername\web.csv''
WITH (FIELDTERMINATOR ='' ,'')'
EXEC(@bulk_cmd)
try this:
DECLARE @bulk_cmd varchar(1000)
SET @bulk_cmd = 'BULK INSERT tblWebs
FROM ''c:\foldername\web.csv''
WITH (FIELDTERMINATOR ='' ,'')'
EXEC(@bulk_cmd)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
gbshahaq:
Thanks...don't know bout you but I'm not particular...just want to 'ger er done!
Points being awarded now
Thanks...don't know bout you but I'm not particular...just want to 'ger er done!
Points being awarded now
SET @bulk_cmd = 'BULK INSERT tblWebs
FROM ''c:\foldername\web.csv''
WITH (FIELDTERMINATOR =' ,')
EXEC(@bulk_cmd)