Accessing Network Files in BULK INSERT command

  • Hi,

    I am using BULK INSERT command to insert data from a comma separated file to a table. This works fine when the file is present on the local machine. But does not work if I try to give a network file path for the same. I tried to give the file name in the format

    '\\<MACHINE NAME>\C\<FILENAME>' But this format does not work. How can I access the network files in the Bulk Insert command.

    Thanks in advance.

    Ashish

  • I guess u need to have share permission on that foilder , and if not then use net use and create a script using bcp command prompt utility and put this command in the BAT file. if u have share permission on the folder where the file lies on the network it will do the copy. I have tried that out locally.

  • I use UNC paths all the time to import text files. Your format is fine, and like jaybmehta said, you need the correct permissions to the share. I just wanted to add that if it's a scheduled job, I'm sure you know that the log-on for the Sql Agent will be the one needing the share permissions, and of course, to test it you could log in as that user and run the commands in query analyzer, etc...

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

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