dbTalk Databases Forums  

++++ Automate Query +++++++

microsoft.public.sqlserver.setup microsoft.public.sqlserver.setup


Discuss ++++ Automate Query +++++++ in the microsoft.public.sqlserver.setup forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
WildPacket
 
Posts: n/a

Default ++++ Automate Query +++++++ - 04-06-2010 , 10:34 AM






Not a SQL guy .....

Want to schedule the query to run automatically -> import data to a file and
email me. Using SQL 2005 Express Edition with SQL Management Studio Express.

Advise Please.

Thank you

Reply With Quote
  #2  
Old   
Rick Byham, MSFT
 
Posts: n/a

Default Re: ++++ Automate Query +++++++ - 04-06-2010 , 03:38 PM






To run that query automatically entirely from within SQL Server you need the
SQL Server Agent. But SQL Server Agent is not included in SQL Server Express
Edition.
So you will have to create a Windows job that will connect to SQL Server and
execute the statement.
There are a variety of tools you can use.
See How To Schedule Tasks in Windows XP
http://support.microsoft.com/kb/308569
I think PowerShell also has a scheduling system as well.
And the task will probably use sqlcmd or osql to connect to SQL Server and
execute some set of statements. I hope this gets you started.
--
Rick Byham, MSFT
(Implies no warranty or rights)


"WildPacket" <WildPacket (AT) discussions (DOT) microsoft.com> wrote

Quote:
Not a SQL guy .....

Want to schedule the query to run automatically -> import data to a file
and
email me. Using SQL 2005 Express Edition with SQL Management Studio
Express.

Advise Please.

Thank you

Reply With Quote
  #3  
Old   
RobertK.
 
Posts: n/a

Default Re: ++++ Automate Query +++++++ - 04-09-2010 , 09:56 PM



I second Rick's suggestion of PowerShell. I use it to perform tasks like this
a lot. I have several reports/alerts that I have automated using PowerShell
to issue a SQL query and then send an HTML formatted message.

Look at http://sqlpsx.codeplex.com/ for some cool tools!

"Rick Byham, MSFT" wrote:

Quote:
To run that query automatically entirely from within SQL Server you need the
SQL Server Agent. But SQL Server Agent is not included in SQL Server Express
Edition.
So you will have to create a Windows job that will connect to SQL Server and
execute the statement.
There are a variety of tools you can use.
See How To Schedule Tasks in Windows XP
http://support.microsoft.com/kb/308569
I think PowerShell also has a scheduling system as well.
And the task will probably use sqlcmd or osql to connect to SQL Server and
execute some set of statements. I hope this gets you started.
--
Rick Byham, MSFT
(Implies no warranty or rights)


"WildPacket" <WildPacket (AT) discussions (DOT) microsoft.com> wrote in message
newsD1F08E8-3AA6-403A-A4E1-0AE8654D84EC (AT) microsoft (DOT) com...
Not a SQL guy .....

Want to schedule the query to run automatically -> import data to a file
and
email me. Using SQL 2005 Express Edition with SQL Management Studio
Express.

Advise Please.

Thank you


.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.