Click here to Skip to main content
15,886,545 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello Coders :-)

I have a littile Intresting logical question.

Actually I have to run some Database query Every day at specific time interval.....

It will be autometically ....

I have some solutions but I wants ti know What do u think About this Question... and how will u handle it....by trigger ,or by asp.net coding , or somthing else ?

How ?

What a correct and secure way to handle it ....
Plaese give some coding examples...

Please give ur suggestions. please.....

thanks in advanace.
Posted
Updated 16-Apr-12 4:03am
v2
Comments
Arav Pradeep Gupta 16-Apr-12 10:17am    
Hi,
As per my suggestions you should create a SSIS package( BY TAKING A SQL TASK) in which you write direct your sql or put stored proc if want.

finally just schedule the package what time you what to execute the Query.

Looking forward you feedback on my ans on your question.

Thanks
Pradeep Gupta
shishir26 27-Apr-12 3:33am    
But I wants My answer with out sqlserver agent service.. Please Help Give some technical trick
shishir26 27-Apr-12 3:33am    
But I wants My answer with out sqlserver agent service.. Please Help Give some technical trick

SQL Server has a SQLAgent application which runs as a service and you can create jobs for it to run at any specific time, so you don't have to write any code.
 
Share this answer
 
Comments
shishir26 16-Apr-12 10:08am    
why ?
Mehdi Gholam 16-Apr-12 10:14am    
Why what?
shishir26 27-Apr-12 3:33am    
But I wants My answer with out sqlserver agent service.. Please Help Give some technical trick
shishir26 16-Apr-12 10:10am    
can I write some triggers..?
Mehdi Gholam 16-Apr-12 10:14am    
Trigger are for doing work when something changes on tables, not for running commands at certain times.
You can Use SQL Job for your Requirement.

Go through the links present in this link to know how to schedule a SQL Job

How to use Sql job Schedular[^]

http://www.dailycoding.com/Posts/step_by_step_guide_to_add_a_sql_job_in_sql_server_2005.aspx[^]
 
Share this answer
 
v2
Comments
walterhevedeich 17-Apr-12 2:25am    
My 5.
P.Salini 17-Apr-12 2:35am    
Thank you Walterhevedeich
shishir26 27-Apr-12 3:33am    
But I wants My answer with out sqlserver agent service.. Please Help Give some technical trick
Hi,

As per my suggestions you should create a SSIS package( BY TAKING A SQL TASK) in which you write direct your sql or put stored proc if want. finally just schedule the package what time you what to execute the Query. Looking forward you feedback on my ans on your question.

Same suggestion I gave you still i would like to tell you how to do this task.

You can create SSIS package by following steps.
#1:- From Sql Server BI, just drag and drop the execute sql task and set the properties like you can set which stored procedure you want to execute.

Once you create the package it needs to configure with SQL Agent.
Go through the link to do that.

http://technet.microsoft.com/en-us/sqlserver/Video/ff686764.
looking forward for your feedback.

Thanks
Pradeep Gupta
 
Share this answer
 
v3
Comments
walterhevedeich 17-Apr-12 2:23am    
Nice suggestion. But I think this will require OP to install SQL Integration Services to his database server if he does not have it. In addition, in my opinion, it would make more sense to just create an SQL job if its not an ETL task, which is the purpose of SSIS anyway.
Arav Pradeep Gupta 17-Apr-12 2:27am    
Yes, It could be..... If he had not installed SQL Integration Services to his database server.
shishir26 27-Apr-12 3:33am    
But I wants My answer with out sqlserver agent service.. Please Help Give some technical trick

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900