Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SP /Trigger -  File Search to begin jobs.

Posted on 2001-06-18
3
Medium Priority
?
238 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 800 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
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.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

636 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