SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

rmg1
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?

webfred
Flowing Fount of Yak Knowledge

Germany
8766 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

Sachin.Nand
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.

PBUH

Go to Top of Page

rmg1
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

Deepak1983
Starting Member

India
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.

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.2 seconds. Powered By: Snitz Forums 2000