Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Using Script Task to check if Folder Exists


Using Script Task to check if Folder Exists

Author
Message
mrtrich99
mrtrich99
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
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.
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)

Group: General Forum Members
Points: 8379 Visits: 19501
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.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
berokke1
berokke1
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 93
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search