Solved

SQL code to perform a the functions described in the body of this question

Posted on 2014-04-03
4
212 Views
Last Modified: 2014-04-10
Could somebody help with coding in SQL to perform the following...

check folder - \\cluster\data\Direxxis\Erie\incoming\
if there is a matrix file ā€“ eg. Erie_Creative_Matrix_20140403.xlsx
remove the date portion eg. _20140403
copy matrix file without the date portion to \\cluster\data\Direxxis\Erie\incoming\
    - but before changing the file name copy the original eg. Erie_Creative_Matrix_20140403.xlsx to
\\cluster\data\Direxxis\Erie\Archived_Incoming\CreativeMatrix

run dtsx (with new file name eg. Erie_creative_Matrix.xslx)
\\cluster\data\Direxxis\Erie\Programming\IMPORT_Erie_Creative_Matrix_STAGE.dtsx

Thanks in Advance
0
Comment
Question by:tesla764
  • 2
4 Comments
 
LVL 13

Assisted Solution

by:magarity
magarity earned 100 total points
ID: 39976694
Isn't this sort of thing more suited to a DTS package?
0
 
LVL 9

Accepted Solution

by:
Sreedhar Vengala earned 400 total points
ID: 39976918
This is can be acheived within your DTSX (SSIS) package.  You can have a pre-load process wherein you can use Script Component and write bit of C# code to read the designated Directory and check if there are any files which contains file name with work 'Matrics', if exists split on '_' and assemble back with appropriate name. And then copy to destination designated directory.

Further in next step you can load your data.
0
 

Author Comment

by:tesla764
ID: 39978138
Hi Sreedhar,
  Could you tell me how to use the script component and give a working example of the c# code to read the designated directory to check for files have have the name "Matrix". And then the rest of the code you mentioned, if exists split on '_' assemble back with appropriate name and copy to designated directory.

Thanks
0
 

Author Closing Comment

by:tesla764
ID: 39992790
Thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
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ā€¦

791 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