| Author |
Topic |
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2007-01-22 : 06:00:56
|
| Hello Everyone,I developed my custom screens in VB which is a process screen will automatically read the values based on some condition and insert or update the values in to the table. MY client do not want to start the process using the VB screen, instead they need the program to run automaically from the sql server with the interval of 1 or 2 hrs.Please advice how to do the above using sql services.Thanks,Senthil .G |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 06:02:09
|
| Rewrite the VB program as an NT service and have it run for every 2 hours.Peter LarssonHelsingborg, Sweden |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-01-22 : 06:03:39
|
why not create a stored procedure to perform the same function ? KH |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 06:06:11
|
quote: Originally posted by khtan why not create a stored procedure to perform the same function ?
Way too easy Peter LarssonHelsingborg, Sweden |
 |
|
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2007-01-22 : 06:08:59
|
| Khtan,If I written the code in Stored procedures how will you call in Sql. I am not going to use the VB code to call the sp. Instead I am going to process the same as what the VB screen doing. Can I run the process automatically for every one or two hrs? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-01-22 : 06:09:26
|
Sorry . . what was i thinking  KH |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 06:11:34
|
quote: Originally posted by gurusamy.senthil If I written the code in Stored procedures how will you call in Sql.
You simply create a JOB that runs every 2 hours and calls the stored procedure you have written earlier.Peter LarssonHelsingborg, Sweden |
 |
|
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2007-01-22 : 06:12:48
|
| Like windows and web service, Can we write sql service in Sql server?Tell me how to create and write the Sql services. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 06:14:44
|
| I give up.Use Google and do a thorough search...Peter LarssonHelsingborg, Sweden |
 |
|
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2007-01-22 : 06:15:07
|
| I think that will work but tell me after creating the job how to implement the Job in clint side. Am I have to follow any instruction to start the job in client side? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 06:18:28
|
| The job is ON the server, no client side involved.You simply schedule the job to run with an interval of your choice.Peter LarssonHelsingborg, Sweden |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-01-22 : 06:19:11
|
| Jobs are meant to be run at Server side not client side. 1. You can use SQL Server jobs in case your task is entirely based on the SQL2. you can create Windows Service application in case of VB.Net or C#.net and then schedule the service3. In case you are using VB 6.0, you can create application and schedule it to run at specific interval using Windows Task Scheduler.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 06:22:24
|
| 3.5) It is possible to write NT Services with VB 6.0 with the help of the activex control ntsvc.ocxPeter LarssonHelsingborg, Sweden |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-01-22 : 06:25:04
|
quote: Originally posted by Peso 3.5) It is possible to write NT Services with VB 6.0 with the help of the activex control ntsvc.ocxPeter LarssonHelsingborg, Sweden
Is it? I was not aware of it.Thanks Peter for the information!Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 06:28:11
|
| Yes, it work great too!It is a free download from Microsoft as well.Peter LarssonHelsingborg, Sweden |
 |
|
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2007-01-22 : 13:00:26
|
| Thanks for everyone for your replies.I have tried to create the Job in Sql server with the help of one site but it fails and result many errors.Can anyone start my engine of how to proceed and write a Job in Sql server 2000 or any links which you perfers.Please advice.Thanks,Senthil .G |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 13:02:41
|
| For jobs to work, you must have SQL Server Agent running.Peter LarssonHelsingborg, Sweden |
 |
|
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2007-01-23 : 01:15:57
|
| I am question. Can I have my stored procedure inside the Job or I have to give sentence like exec <stored procedure>. Which method is correct? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-01-23 : 01:18:39
|
you create a job and in the scriptexec <stored procedure> KH |
 |
|
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2007-01-23 : 01:44:25
|
| Thanks khtan that works fine.In this Transact-Sql I also posted another question of File print in sql server. Please take a look and advice me. |
 |
|
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2007-01-23 : 08:29:49
|
| Consider an employee table and for some employee salary should be zero. Now I am want to write a sp and then the employee whose salary is zero been moved to log file. So using a Sql service can I print a record in text files. |
 |
|
|
Next Page
|