How to check the folder, In that folder .tmp file created or not through SSIS 2008 r2
Hi All I have one requirement. I have one folder (sep2012) This folder every time month name is will chanage.This will do C# script. Through Script task we are calling .Exe file, that .exe file will create automatically .tmp file. Now my requirement is every month will check the .tmp file is created or not, Its not created fail the package and check the .tmp file size it should not 0kb ,OKb fail the package . How to do that in SSIS 2008 R2... Vasu vasu
September 30th, 2012 7:28am

Hi , Otherwise provide me C# Script also. Vasu vasu
Free Windows Admin Tool Kit Click here and download it now
September 30th, 2012 7:52am

1) use the script to check for .tmp files with Directory.GetFiles. Something like string[] dirs = Directory.GetFiles(@"c:\folder\", "*.tmp"); http://msdn.microsoft.com/en-us/library/wz42302f.aspx 2) use the Foreach enumerator to loop through a folder with wildcard *.tmpPlease mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
September 30th, 2012 7:56am

Hi, Thanks for your reply . Please give me the full detail clarification how to use of for each loop. Vasu vasu
Free Windows Admin Tool Kit Click here and download it now
September 30th, 2012 8:00am

Here is how the Foreach loop works http://microsoft-ssis.blogspot.com/2011/02/how-to-configure-foreach-loop-file.html You could just leave the foreach loop empty and in the precedence constraint after the foreach loop you can check if the variable is filled with something.Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
September 30th, 2012 8:13am

Hi , Iam useing this script for my requirement and please give me valuable sug.. any thing is missing // check the .tmp fiile exist or not string tempFile= Dts.Variables["str_inifile_Parameters_LogFolderPath"].Value.ToString() + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month) + DateTime.Now.Year.ToString() + vasu.tmp"; //FileInfo f = null; if (System.IO.File.Exists(tempFile)) { FileInfo f = new FileInfo(tempFile); long len = f.Length; if(len>0) { } else { send a mail for >0 records } } else { send a mail for .tmp file not exists } vasu
Free Windows Admin Tool Kit Click here and download it now
September 30th, 2012 11:01am

You could fail a SSIS variable with some value and use that in a Precedence Constraint to the next tasks (email tasks)Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
September 30th, 2012 1:31pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics