Solved

Clear a table depending on a file name

Posted on 2009-03-30
7
248 Views
Last Modified: 2013-11-10
I  have  a  execute  process task that runs a scipt and gets files from a  site
it gets the files and  puts  them in a folders in  local system. The file name is some thing like this
xyz_date(xyz_033009).now my task is once the file is in a local folder and if file name is not todays date ,i mean file name which has date in it is not  todays date i have to do nothing. If  file date has todays date  then i have to clear a table. How  can i do this
0
Comment
Question by:svs1919
  • 4
  • 3
7 Comments
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24020016
Check the attached file...
let me know if it helps you!
You need to customize your script in order to resolve your issue!
Regards,
pedro

www.pedrocgd.blogspot.com
Post-SSISEX01.doc
0
 

Author Comment

by:svs1919
ID: 24020190
So i have to use a script task after this execute process tasK. Can any one help me with this as i am not  a .net ot  java person
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24020434
You have Process task to copy files to folders in  local system, correct?
use ForEach Loop to read each of this file...
Add a script to inside ForEach Loop... inside script set the status of the work to do after this task in a SSIS variable...
Check the doc file...
helped?
regards,
Pedro
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:svs1919
ID: 24022132
i tried but i am unable to get it in for loop container how do i how can search for the with extension todays date. do i have to write it in script task
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24027482
Use a script task, and inside .net code...
helped?
0
 

Author Comment

by:svs1919
ID: 24029183
yes it did but a small problem the file name that  i am looking for has a date extension. I am trying to put that file name in the variable and its not working i am struck with that point.
i ahve to look for a file some thing like this xyz_date(xyz_033109) to get this working in one of the variables that looks for the  file i gave the name as
xyz_+RIGHT("0" + (DT_STR, 2, 1252)  MONTH( GETDATE()  ), 2) + RIGHT("0" + (DT_STR, 2, 1252)  DAY( GETDATE()  ), 2) + RIGHT((DT_STR, 4, 1252)  YEAR( GETDATE()  ),2) + .xls

but its not working how can i fix this. Can i declare some thing like this in a variable?
0
 
LVL 22

Accepted Solution

by:
PedroCGD earned 500 total points
ID: 24030931
Check the attached package that I made to other question.
Helped?
regards,
Pedro
www.pedrocgd.blogspot.com

SSIS-Interface.JPG
testfile-120109.xls
testfile-140109.xls
Package-EE75-dtsx.txt
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

828 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