How to create a SSIS package to delete word documents from local system

Hi All,
How to create a small SSIS package to delete word documents from local system. Word documents might be one or two weeks ago.
Thanks in advance for your help.

    Dim filename As System.IO.FileSystemInfo
        filename = My.Computer.FileSystem.GetFileInfo("c:\temp.doc")
        If (Now.DayOfYear - filename.CreationTime.DayOfYear) > 3 Then
            'filename.Delete()
        End If
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • How to create a SSIS package

    Create a SSIS package for following scenario
    I have one excel file which will contain 10 records for Monday, 12 records for Tuesday, 7 on Wed, no records on
    Thursday so if records are there I get mail if no records are there I didn't get mail daily.

    Hi,
    You can use Row Count transformation to capture the number of records in a variable and then depending on the count you can send out an email.
    Following are the steps.
    Create a variable RecordCount of type int (Int32).
    Add a Data Flow Task.
    Create an Excel Connection Manager and connect to the excel file.
    Add an Excel Source and select the Excel Connection Manager.
    Add a Row Count Transformation and select the variable RecordCount in VariableName under Custom Properties.
    Add a Send Mail Task in the Control Flow and connect it to the Data Flow Task
    Configure your Send Mail Task as per your requirement. You will have to specify an SMTP connection.
    Double click on the Precedence Constraint.
    Select Expression in Evaluation operation
    Set Expression as @[User::RecordCount]>0
    Hope this will help.
    Regards

  • How to execute an SSIS package on a scheduled basis from remote server and pass in input files

    I have an application server and a db server.  My db server has all things SQL Server stored on it (DBMS, SSRS, SSIS, etc.)  I have several nightly batch process SSIS packages (dtsx files currently) that will pickup an input file and import them
    into the database.  I would like to execute all batch processes from my application server as I have quite a few other ones as well that do other stuff outside of SQL Server via powershell.  My question is how to do this?  Is there away to execute
    them remotely via DTexec.exe, should I set them up as Agent jobs and somehow pass in the file names\location (how?), create and SSIS catalog, etc.?  
    I need to easily be able to see if the packages execute successfully or not and if not capture the detailed information of why they failed from the remote server so I can use that to drive my process flow logic in the batch processes.

    Hi Jason,
    According to your description, you want to execute a package on a schedule and receive notification when package ends with error in the job.
    After testing the issue in my environment, we can directly add the package in a step of a job, then add a schedule and set the Alert and Notification property in the job to achieve your requirement. For more details, please see:
    Create a Database Mail in the SSMS.
    Right-click the SQL Server Agent services to Enable mail profile, then select the appropriate Mail profile.
    Under the Operators folder, create an operator with the correct E-mail name.
    Right-click the Jobs folder to add a new job.
    In the Steps pane, New a step with SQL Server Integration Services Package Type to run the package.
    In the Schedules pane, New a schedule for the job.
    In the Alerts pane, New an alert with SQL Server event alert, then enable Notify operators option with an operator in the Response pane.
    In the Notifications pane, enable Email option with same operator and When the job fails selection.
    Then when the package fails, the job would be failed and we can receive the error message in the mailbox.
    Besides, please make sure the account that execute the job has correct permissions for the file, for the folder that contains the file, and for the database.
    References:
    Configure Database Mail – Send Email From SQL Database
    How to setup SQL Server alerts and email operator notifications
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • How to create a error message for Deleted batch while creating a PO

    Hi ,
    Can any body tell me how to create error message for a deleted batch while creating a PO in ME21n,
    when a PO is created for a deleted batch at GI &GR lebel it is showing  a error message,
    but i want to show a error message while doing the PO creation.
    Thanks,
    Sachhi

    in badi  me_process_po_cust u can  put this message
    METHOD if_ex_me_process_po_cust~check.

  • How to create the BC4J Package in JDev 10g (with OAF)?

    Hi everbody.
    in JDeveloper 10.1.3.1.0
    How to create the BC4J Package for Client Object or Server Object?
    In JDeveloper 9i Ext,
    1. select the Project in Navigator
    2. right-click and select "New Business Components Package... " from the context menu
    3. "Business Component Package Wizard" page appears.
    In JDeveloper 10, I cannot find "New Business Components Package..." from the context menu on the Project.

    Do you have the OA extension installed ?
    If not then please follow the thread Oracle JDev 10g with OAExt for Release 12 now on Metalink
    for more information in this regard.
    --Saroj                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to create a software package for PDA?

    On the configuration guide for MI7.1, page 30, it refers a OSS note 1042773
    about how to create a software package on PDA.
    However when I try to pull out note 1042773, I get an error:
    " An SAP note with the number requested could not be found.  "
    Please help give the right note or the method to create software pack for PDA.
    Thanks a lot!

    Hello,
    I will forward this issue to the responsible person, this will be fixed asap.
    Best Regards,
    Stefan

  • How to Create a OLAP Cube in DEV using SSAS from Raw file system backup from Production?

    How to Create a OLAP Cube in DEV using SSAS from Raw file system backup from Production? I dont have a .abf file available. Two paritions in production are missing data. We were able to get back file system backup which contains the files for these two paritions.
    How do I create a cube in Dev using this file system backup.
    we are on SQL Server 2008R2.
    Thanks,

    How to Create a OLAP Cube in DEV using SSAS from Raw file system backup from Production? I dont have a .abf file available. Two paritions in production are missing data. We were able to get back file system backup which contains the files for these two paritions.
    How do I create a cube in Dev using this file system backup.
    we are on SQL Server 2008R2.
    Thanks,

  • I've created a Word document from a pdf file. How do i make it editable?

    I've created a Word document from a pdf file. How do i make it editable?

    Hi Kaz1,
    The Word document should be editable after the conversion is complete.  What happens when you try to edit it?
    Thanks,
    David

  • How to delete a document from a strange part of finder?

    There's an area of finder directly to the left of the back arrow where I was unaware that you could place documents. I dragged one up there by accident, and now I'm not sure how to get rid of it. I tried simply deleting the document from the folder and sticking it in the trash, but now it just appears as a question mark. I'm sorry that this is such a poor description, but any assistance at all would be greatly appreciated. I have no idea what this area's called or what it's supposed to do.

    Control-click it and choose Remove Item. That area is meant for quick access to items and controls.
    (56965)

  • How to create a VI that detects and records responses from user

    Does anyone has experience in creating a VI that allows the user to e.g., watch a video or series of images, pause or rewind video etc. and the VI records the duration of all pauses or user responses.

    avenue wrote:
    How to create a VI that detects and records responses from user
    You definitely need to check what 'EVENT STRUCTURE' is and how to use it... because thats needed to write such code.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • How do I change a PDF to a word document?

    How do i change aa PDF to a word document?

    In Mac preferred method (because it uses Adobe's PDF engine):
    Save file as word Document (for Backup)
    Go to Print Menu
    Click and hold on PDF button until context menu appears
    Choose Adobe PDF
    Wait for menu to change - choose quality (this eqivelent to job options in Distiller) and turn off open with Reader (or Acrobat)
    Then click okay to go to nex window item
    Either use Title assigned or change (I usually remove references to Microsoft Word-, and .docx so it just shows as for example Joes.pdf),
    Browse (pick out) to desired save Location.
    Click Save.
    Go to location saved and open.
    Notes: Expect to multiple PDF if the Word document page have switches in Page orientations.
    URL links won't cme over with this method.
    To have Urls to be active (except those created with the Format menu > URL)
    Do the following:
    Locate the Word Document
    Locate the acrobat Icon on the Dock (similar to Start up menu on PC)
    Drag the word document to the icon of Acrobat on Dock and Drop
    Wait ........... You might have enough time to boil you a pot of coffee
    When PDF pops up on screen save at once!
    You will now have a document that will have live MailTo's and URL's except for those created with the URL wizard ( select desired word> go to Formtat menu > URL >when opens type desired URL or Mailto)
    This is a 15 year old bug Adobe refuses to fix. Don't bleive the blather the put out bout the proper hook in Mac Version That's been proven as false years ago.

  • How to edit a converted Word Document from a PDF file

    how to edit a converted Word Document from a PDF file

    Hi Edit Converted Word Doc,
    What's happening when you try to edit the file? Have you tried triple-clicking in the text block that you want to edit?
    Please let us know what sort of trouble you're running into. It would also be helpful to know how the PDF file was created, and what version of Word you're using.
    Best,
    Sara

  • Create/Edit Word documents from Form 6 in the web

    How can I create/edit Microsoft Word documents from a form running under IAS.
    In client/server I can do it using OLE2.

    On the Web the OLE2 option would still work if your Forms server is on a windows machine with word on it. The files will be created on the server and you can get them to the client with the web.show_document built-in.
    If you want to create them on the client machine directly you need a Java bean that will activate the COM interface.

  • How to copy NCLOB value(Contains Word Document) into file system

    How to copy NCLOB value(Contains Word Document) into file system or display in sqlplus

    The UTL_FILE package will write it only to text file not(NCLOB Value[containts images as well as text])

  • Why when I delete a document from the print que does it not delete?

    When I send a document to my hp photosmart printer and there is an error, I go in to delete the document from the print que on my hp laptop and it shows it as being deleted but nothing happens and I can't print any other document. How do I fix this?

    If your problem is not resolved please read this post then provide some details.  What exactly is your printer model?  (There are hundreds of Photosmart models...)  What operating system?  How is the printer connected?
    All the Photosmart printer models except the first one had a  "cancel" button on the front panel.  It may be easier to press this to cancel the print job rather than deleting the print job from the spooler. The cancel button is typically marked with an "X"; pressing it will stop printing and discard the remainder of the print job.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

Maybe you are looking for