473,748 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to bulk insert because file 'C:\Inetpub\www root\Webfile1\D ata\upload.txt' ....

347 Contributor
I have a web page written in asp.net that is basically an upload button that does a bulk insert into a sql table.

When a user presses an upload button, a .txt file is uploaded to a directory on the web server, and also inserted into a sql server on my network. I can get the file to upload to the correct destination but when the server tries to bulk insert to the database I get the following error:

Could not bulk insert because file 'C:\Inetpub\www root\Webfile1\D ata\upload.txt' could not be opened. Operating system error code 3

I have attempted to use UNC for the path for the file, but as the file is being uploaded in the first place, that doesnt seem like the problem. I also modified the machine.config on the web server to have the asp.net instance log in as the administrator on the web server, the permissions of the Data directory is set to everyone to have admin rights to that folder. On the sql server, bulk administer permissions are enabled and there are no contraints for triggers or keeping identity. Can anyone please help me understand why this isnt working?

Thank you,

Doug
May 14 '10 #1
1 2913
ck9663
2,878 Recognized Expert Specialist
The file is on your client side. Search for some free script on how to upload file to an ftp server and subsequently upload it to your SQL Server.

Happy Coding!!!

~~ CK
May 17 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
4900
by: me | last post by:
I'm also having problems getting the bulk insert to work. I don't know anything about it except what I've gleened from BOL but I'm not seeming to get anywhere...Hopefully there is some little (or big) problem with my code that someone can point out that may save me some time. TIA CBL
7
12129
by: iqbal | last post by:
Hi all, We have an application through which we are bulk inserting rows into a view. The definition of the view is such that it selects columns from a table on a remote server. I have added the servers using sp_addlinkedserver on both database servers. When I call the Commit API of oledb I get the following error: Error state: 1, Severity: 19, Server: TST-PROC22, Line#: 1, msg:
1
2972
by: gchavez | last post by:
I'm running MSSQL 2K on Win 2k and just upgraded SQL Server from SP3 to SP4 (that's when my problem started). I have a procedure that bulk inserts from a text file that is located on a Netware 4.11 file server. The procedure actually references the file using the UNC path to a share on a NT 4 server that is connected to the novel server using gateway services for NetWare. Now when it tries to reference the file I get: Server: Msg 4861,...
1
12840
by: Mike | last post by:
I am trying to use the 'Bulk Insert' command to load a data file into a MS-SQL db. The line I am using is: Bulk Insert SVC_Details From "C:\XFILE.TXT" With (FieldTerminator = ',') I have tried the file name with " around it and with ' around it and both the " and ', but every time the Query Analyzer comes back with the following error: ---Begin Error Msg---
0
2444
by: m31hu1 | last post by:
Hi all, I'm new to this forum... I'm trying to let sql store data from a text file, but the data won't display... what am i missing here? Your help is greatly appreciated. create table <?php $con = mysql_connect("localhost","root","password"); if (!$con) { die('Could not connect: ' . mysql_error());
1
8949
by: Jennifer | last post by:
I'm trying to do an insert using Bulk Insert with a fixed length file. I'm using a format file. I'm getting the following error message: Cannot perform bulk insert. Invalid collation name for source column 16 in format file '\\wbhq.com\dfsdv\iDataInt\GOPFiles\GOPFormatFile.txt'. Any suggestions are appreciated. Thanks! Jennifer
2
1673
by: Jackson | last post by:
Hi GUYS My name is Jackson. I have been strugling to get the BULK INSERT statement import data from a text file to the database. Have a look at this piece of coding: DECLARE @SQL VARCHAR(1000) set @SQL = 'BULK INSERT dbo.#temp FROM ''C:\Documents and Settings\mmelestj\Desktop\Dekany.txt'' WITH (FIELDTERMINATOR = '','', ROWTERMINATOR
0
3014
by: ozkhillscovington | last post by:
We have sp's in place that do BULK INSERTS from txt files into the tables. This works fine, however they have asked us to add a field that identifies accounting ctr. The only thing that identifies accounting ctr is the last three letters of the text file being used for the BULK INSERT. How would you suggest that I do this? Is there a way to add a default value to the .fmt or schema files for the text fields, or in the BULK INSERT...
2
7953
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer. When someone else uses the web app and tries to open a file using the remote server the error below happens. any help? **Code** C# - filepath is a valid file name which is passed via the form. System.IO.BinaryReader br = new...
2
4524
by: jthep | last post by:
How can I use bulk insert to insert a text file where the columns in the text file is in different order than the columns in the table? I have a ZIP table with Zip_Code, Zip_City, Zip_State and the text file has the fields in Zip_City, Zip_State, Zip_Code. The instructions were to keep the order as defined in the Entity Definition which would be the first order. My code for the bulk insert is usually BULK INSERT DB2914.dbo. FROM...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8245
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.