Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Using Script Task to check if Folder Exists Expand / Collapse
Author
Message
Posted Tuesday, June 11, 2013 6:57 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, September 24, 2013 5:00 PM
Points: 50, Visits: 161
Lidou123 (6/6/2013)
Hi,

I have the same problem.
Did you found the solution ?
How to prevent the creation of a folder which already exists


I have not. I just manually rename the first folder created if I ever run into this situation. Fortunately for me it's rare so I just went with the manual solution. Hope you find a solution to your problem and keep us posted.
Post #1462065
Posted Tuesday, June 11, 2013 11:29 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:24 AM
Points: 5,317, Visits: 12,355
mrtrich99 (6/11/2013)
Lidou123 (6/6/2013)
Hi,

I have the same problem.
Did you found the solution ?
How to prevent the creation of a folder which already exists


I have not. I just manually rename the first folder created if I ever run into this situation. Fortunately for me it's rare so I just went with the manual solution. Hope you find a solution to your problem and keep us posted.


I posted some sample code for a Script Task which will create a folder only if it does not exist - see this thread.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1462454
Posted Friday, December 5, 2014 12:35 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, December 16, 2014 2:04 PM
Points: 14, Visits: 83
I'm trying to do something similar however, I was trying to use a Script task to set the path and then use Directory.CreateDirectory method as it says it will create it but checks if it exists first. I figured I would create the folder if it doesn't exist, set the archive path and the error paths, do some processing and then if it fails, I uses the error path variable to move the file to the error path via File System Task or if it succeeds, move the file to the archive path. We have issues with folder becoming too full to be able to manually search for a file and the solution is to have the SSIS package divide them up based on a number.

Any suggestions? I'm new to SSIS so any assistance is greatly appreciated.

Thanks,
Barb
Post #1641945
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse