Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 18th, 2006, 01:04 AM
Registered User
 
Join Date: Oct 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default hi problem on bulk insert command

hi everybody,

i have created a webform with a button to read bulk data from a .CSV file from a path :C:\karfiles\myfile.csv

iam using a bulk insert command to insert all records into database in VS 2005 WINDOW APPLICATION C# USING SQL SERVER 2005.

when i click the button iam getting this exception :

"An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll

Additional information: Could not bulk insert because file 'C:\karfiles\myfile.csv' could not be opened. Operating system error code 3(The system cannot find the path specified.)." at cmd.executenonquery.

i want to trouble shoot this exception .

please can anybody help me?

thanks,
karthik.

 
Old November 8th, 2006, 04:22 AM
Registered User
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to talenone Send a message via MSN to talenone Send a message via Yahoo to talenone
Default

Hi Karthik,

First make sure you have been granted access as sysadmin or bulkadmin.

Secondly make sure the file exist in the same path.

Thirdly make sure you are using this command:

BULK INSERT <YourTableName>
FROM 'c:\karfiles\myfile.csv'
WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' )

If still not executing then let me know.

Regards,
Danish Sami.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Bulk Insert Problem starnet SQL Server 2005 5 April 17th, 2007 08:34 AM
hi problem on bulk insert command karthikc85 SQL Server 2005 2 October 18th, 2006 11:32 AM
Bulk Insert Problem pseudo SQL Server 2000 2 October 4th, 2006 06:48 AM
Problem with Bulk Insert starnet SQL Server 2000 1 September 13th, 2006 08:29 AM
BULK INSERT PROBLEM ZoroAstris SQL Language 3 January 3rd, 2005 09:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.