Bulk Insert in a Stored Procedure

  • Any help would be grateful. I am trying to bulk insert large files into a SQL 7.0 table. I have a VB app that creates the file in the correct order and I have a script that works great for Bulk inserting the created file into the table. I would like to make this process a one step. All the user would have to do is kick off the VB app and it would call stored procedures to Bulk insert the file into the table. My Bulk statement is as follows:

    Bulk Insert MIS.dbo.tblAccts From "\\FileServerName\DataFiles\dbFile.txt"

    When I have this statement in a stored procedure and the VB app calls it I receive an error "Operating system error code 5(Access is denied)" Everything runs fine when I run the T-Sql statement with Query Analyzer. Is there some permission that I am missing.

    Thanks in advance for your help

  • It might be permissions. When you run from QA, it is running as your connection. When it runs from VB, it runs under the context of the Vb connection. Check that the rights on the network are correct. This error is an NT/2000 error, not a SQL error.

    Steve Jones

    steve@dkranch.net

  • Only the system admin (SA) can use the BULK INSERT statement. Are you giving your VB app this access? I hope NOT!!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply