Solved

SP /Trigger -  File Search to begin jobs.

Posted on 2001-06-18
3
234 Views
Last Modified: 2008-03-06
We are using FTP to transfer a number of files from another machine(the type and details are not important) to SQL Server.  
At the end of the nightly process I will receive a Text file called READY.txt, which will let me know that the process has completed from that server.

I would like to create a sp that checks every five minutes for that file.  I understand the job schedule portion.  

THE QUESTION:  How do I create either a DTS package or a sp to search for this file to start my evening's / morning's processes?  I am looking for something that states:  
          If C:/FTP/READY.txt exists
          Then go to the next step
          Else keep waiting until my time is up.

Thanks.

         
0
Comment
Question by:brine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:nigelrivett
ID: 6203070
something like this in an sp scheduled every 5 mins.

create table #a (s varchar(1000))
insert #a
xp_cmdshell 'dir /B C:/FTP/READY.txt'

if exists (select * from #a where s like ...)

look at the result you get in #a for the file - you might want to check the file date too.
0
 
LVL 18

Accepted Solution

by:
nigelrivett earned 200 total points
ID: 6203178
more like

create table #a (s varchar(1000))
insert #a
exec master..xp_cmdshell 'dir C:/FTP/READY.txt'

if exists (select * from #a where s like '%'READY.txt%')


(I do a like instead of /B with = because you will probably want to look at other attributes too).



0
 

Author Comment

by:brine
ID: 6207669
Thanks ... Sorry I took so long to respond, but I needed to make time to test.  
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Query Task 11 44
SQL Query Returns Records in SSMS but not Classic ASP 5 26
Delete old Sharepoint backups 2 22
SQL profiler 3 18
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

726 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