Last post Feb 02, 2011 01:58 PM by optempo
Jan 24, 2011 03:38 AM|jubbabo|LINK
Hi, I got one project to develop. The requirement is that
1. Retrieve data from sql server database
2. extract to txt file as tab delimiter
3. save into designated location
4. upload that txt file to another server by ftp
5. the vice versa job step
All of this tasks will be auto-run on the server at the specific time and recurrent.
What I think is to create one exe file to run all the tasks from 1 - 4 and another file for no. 5. And use Schedule Tasks from window OS to run that file.
Do you think if it's possible and good approach? Any idea to suggest?
Actually, I'm quite new for exe application (I think I have to create as an console application, right?). So I never test to coding to use ADO.NET to connect sql server and upload txt file by ftp.
.net C# jobs
Jan 24, 2011 04:32 AM|Lateef045|LINK
Two suggestions from my side.
1. You should use a more robust form of datafile other than text file. You will face difficulty reading the text format at the other end. I would suggest you to use XML format for this purpose. Also converting a dataset to xml is much easier.
2. You can go with the console application. But for this you will have to schedule a windows job to run the job at particular time interval. You can also go with the Windows Service. With windows service, the project will be much clean and you can put your
time duration in a config file.
Jan 24, 2011 04:36 AM|krisrajz|LINK
Create a windows service application which should start automatically
Create WCF to send/receive files
Jan 24, 2011 05:05 AM|selfmotivated|LINK
I am agree with krisrajz. Windows Service would be the best solution for your kind of project.
Jan 24, 2011 06:17 AM|Saravanan M|LINK
SQL Server Replication. Replication is a set of technologies for copying and distributing data and database objects from one database to another
Jan 24, 2011 04:36 PM|XtremeBytes|LINK
You can schedule a job using SSIS and use BCP utility to create the tab demilited file and a batch file to do your FTP. Since this is just data related and you dont have to do any UI related activities, SSIS packages looks ideal.
Jan 28, 2011 07:21 AM|jubbabo|LINK
Window service sounds suit for me.
Jan 28, 2011 07:31 AM|jubbabo|LINK
Thanks alot, XtremeBytes.
It's amazing to use BCP. I never know this before. One thing I am not quite sure is
- When I execute BCP queryout txt file to one directory, I have to set directory access permission 'read/write' for the sql account that connect the sql server and execute BCP.
- What if the user to connect sql server wasn't window user account in active directory?
Jan 28, 2011 07:36 AM|jubbabo|LINK
Can everything run under window service only?
Feb 02, 2011 05:58 AM|sarfrazahmed|LINK
WCF is Fairly enough for your scenario , also u can think of archiving /deleting the extracted files, that are present in your local drive. for effective disk space utilization activity.
Feb 02, 2011 01:58 PM|optempo|LINK
I did a medical document processing application like this and I used a multi-threaded Windows Service to handle most of it. Mainly I just setup timers and managed the threads. There was also a web service for remote access by outside clients to submit items
(this was in pre-WCF days).