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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 query scheduling

Author  Topic 

ujjaval
Posting Yak Master

108 Posts

Posted - 2006-09-07 : 01:41:56
I am not sure, if this really belongs to administration category. But I think it is. So here it goes..

I have a query, which I want to run overnight. Its a normal stored procedure. How can I schedule it on SQL Server to run each night?

Thanks,
Ujjaval

Rishi Maini SQL2K5 Admin
Yak Posting Veteran

80 Posts

Posted - 2006-09-07 : 01:59:24
Create a Job in SQL and select the Job step to be of type "Transact SQL" , type your Query,SP in the step and schedule the job to run every night.

Thanks
Rishi Maini
Go to Top of Page

ujjaval
Posting Yak Master

108 Posts

Posted - 2006-09-07 : 02:06:27
Hi,

Thanks for that.. I tried that. In that it has certain limitation of characters limit which is 10249 or something. My sql exceeds the total limit of characters allowed. So, is there any workaround with that? I can make storedprocedure, if I can use that somehow?

Thanks,
Ujjaval
Go to Top of Page

ujjaval
Posting Yak Master

108 Posts

Posted - 2006-09-07 : 02:15:53
Ohh sorry, it just strike me..

can i use

"exec storedprocedureName"?

I guess I can..

Thanks,
Ujjaval
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-09-07 : 02:27:42
quote:
Originally posted by ujjaval

Ohh sorry, it just strike me..

can i use

"exec storedprocedureName"?

I guess I can..

Thanks,
Ujjaval



yes you can


KH

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-07 : 02:31:31
Yes. Make a SP from your code, and create a job that executes the SP with the time interval you want.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

ujjaval
Posting Yak Master

108 Posts

Posted - 2006-09-07 : 02:56:08
Just another thought. Is it possible to have this through command line? Has anyone tried it?

Like I want it in command line so that I can put it in batch file along with other queries which I am running while creating database on other server.

Plus, is it possible to create setup for perticular database installation on sql server?

Thanks,
Ujjaval
Go to Top of Page

Rishi Maini SQL2K5 Admin
Yak Posting Veteran

80 Posts

Posted - 2006-09-07 : 04:34:35
Yes you can put it in Batch File and use "XP_cmdshell" to execute the Batch file from inside SQL Server.

Further I did not get your second question ( Plus, is it possible to create setup for perticular database installation on sql server? )

Can you please elaborate it ?


Thanks
Rishi Maini
Go to Top of Page
   

- Advertisement -