System.IO.File.Copy hangs

Posted on 2011-04-19
Last Modified: 2013-11-30
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:

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?

Question by:rss2
    LVL 21

    Expert Comment

    by:Alpesh Patel
    Please use File System task to move or copy file.

    Author Comment

    The File System task also hangs.

    LVL 21

    Accepted Solution

    It may takes long due to file is big in size.. or windows issue

    Author Closing Comment

    Spot on

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now