Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Run SQL query via Scheduled task
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

256 Posts

Posted - 10/01/2010 :  09:01:13  Show Profile  Reply with Quote
Hi all

This is probably a daft question, but is it possible to run an SQL query via a Windows scheduled task.
The IT bods here won't give us the necessary permissions to set up jobs.

Anyone any ideas?

Flowing Fount of Yak Knowledge

8781 Posts

Posted - 10/01/2010 :  09:03:07  Show Profile  Visit webfred's Homepage  Reply with Quote
It is a very bad idea to do something like this without your IT.

No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Flowing Fount of Yak Knowledge

2937 Posts

Posted - 10/01/2010 :  09:05:24  Show Profile  Reply with Quote
Well you can create a Windows exe & embed the SQL query in it & then schedule it by Windows scheduled task.


Go to Top of Page

Constraint Violating Yak Guru

256 Posts

Posted - 10/01/2010 :  09:16:46  Show Profile  Reply with Quote
Thanks guys. Looks like out IT dept has some work to do (either setting up and managing the jobs or giving us the permissions).
Go to Top of Page

Starting Member

23 Posts

Posted - 10/01/2010 :  09:54:50  Show Profile  Reply with Quote
I don't know but somehow it relates to what u have asked.

If you have permission to SSRS (SQL Reporting Service), you can create one report using that query and using subscription on Reporting Server you can schedule that report.

Deepak Arora
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 10/01/2010 :  10:53:07  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
I think what you really want is to use SQL SERVER AGENT. It's a way to make jobs that are targeted at a database and have 'steps' which you can configure yourself. You then schedule the jobs to run as required (at a certain time each day for example or every x minutes / hours).

Ask your DBA they should be fine with this. At the very least they should be OK with taking your sql, looking at it very carefully and scheduing a agent job themselves if they don't trust you (which they probably wont if they are doing their job properly )

good luck.

Msg 3903, Level 16, State 1, Line 1736
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000