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

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Scheduled Task from a .sql file

Author  Topic 

JoshBrigade
Starting Member

28 Posts

Posted - 2009-11-04 : 09:10:15
HI,
I have SQL code that works, and i saved it as a file from Query Analyser. I set a scheduled task to run the file, but all it does is open the file it doesn't run it like it would have if it were in Query Analyser. So my question is, do i run Query Analyser as a task? and if so how can i specify the file? or do i do it another way.
Thanks,
Josh

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-04 : 09:26:07
Which Version of SQL Server?


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

JoshBrigade
Starting Member

28 Posts

Posted - 2009-11-04 : 09:35:20
We use SQL server 2000 version 8
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-04 : 10:11:49
In Jobstep OSsystem task:
isql -SYour_Servername -dYour_DBname -UYour_User -PYour_Pwd -iyour_filename_with_Path


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

JoshBrigade
Starting Member

28 Posts

Posted - 2009-11-04 : 13:57:38
I'm not sure i understand, i don't see a jobstep ossystemtask the the task manager, or the query analyzer. Or are you talking about something else?
Go to Top of Page

JoshBrigade
Starting Member

28 Posts

Posted - 2009-11-04 : 14:03:20
or more to the point, how would you get a query analyzer script to run at a certain time?
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-11-04 : 14:09:10
Make it a stored procedure. You can then execute the sproc from the job.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-04 : 14:14:10
the tool's name in 2000 is enterprise manager if I remember correct.
There you can schedule jobs


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

JoshBrigade
Starting Member

28 Posts

Posted - 2009-11-04 : 16:00:05
Yes, indeed that is the right thing to do. Thanks to all!
-jb
Go to Top of Page
   

- Advertisement -