Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BULK INSERT Error

Status
Not open for further replies.

Aidy680

Technical User
Joined
Nov 1, 2006
Messages
138
Location
GB
I'm trying to load a .csv file into my SQL 2005 table but get the following error:

"Cannot bulk load. The file "\\server\directory\filename.txt" does not exist."

The file clearly does exist. Does the file have to be on the same SQL server box? Surely this cant be!

Is there a better way of doing this?

Thanks.
 
Maybe the user who run this insert has no rights over that folder?

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
I'm running it Borislav. Trying to get permissions assigned will be a lot of hassle.

I believe I can use SSIS. Not even sure how you launch it tho...!!

Thanks.
 
By way of follow up I ended up using the FileSystemObject and the OpenTextFile command to grab the file.

I then used a combination of 'Mid' and 'InStr' to seperate out the data within each record and assigned each to variables.

The variables were then passed to a SQL proc which inserted them into the table.
 
ewww!

How about just copying the file locally to the SQL Server, then you'll be much more likely able to bulk insert the data since you won't be dealing with network permissions at all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top