System.IO.File.Copy hangs

Hi Experts,

I need to copy a file from one location to a directory local to the SQL Server.

The reason for this is, I am doing a Bulk Insert Task, and it doesn't seem to work when I am accessing the file from a UNC path of a remote location (i.e. \\servername\directory\filename.csv) That is correct, right?

Anyway, I have a script task to copy the file, which is simply:
System.IO.File.Copy(sFileA,sFileB,true)

This step hangs and the task is always yellow (never completes).

I believe this is do to the UNC network path again.. but not sure.

The copy is always successful, it just hangs after that.

How do I tell System.IO.File.Copy to finish?

Thanks,
rss2
rss2Asked:
Who is Participating?
 
Alpesh PatelAssistant ConsultantCommented:
It may takes long due to file is big in size.. or windows issue
0
 
Alpesh PatelAssistant ConsultantCommented:
Please use File System task to move or copy file.
0
 
rss2Author Commented:
The File System task also hangs.

0
 
rss2Author Commented:
Spot on
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.