简体   繁体   English

在SQL Server 2008中手动安排作业

[英]Manually schedule a job in sql server 2008

I want to create a schedule to manipulate some data on server. 我想创建一个时间表来处理服务器上的某些数据。 and i have store procedure which have some sql query. 和我有一些SQL查询的存储过程。 Now i want to exec this sp every day. 现在我想每天执行此sp。

For that i have created job, schedule using sp_add_job, sp_add_schedule etc.. now all this needs to run on my clients server. 为此,我创建了作业,使用sp_add_job,sp_add_schedule等进行计划。现在所有这些都需要在我的客户端服务器上运行。

Now problem is that, I cant run these queries in client server as I don't have "sa" (admin) login. 现在的问题是,由于我没有“ sa”(管理员)登录名,因此无法在客户端服务器中运行这些查询。 So is there any alternate way to run this query? 那么,有没有其他方法可以运行此查询?

And also i cant create job from SQ L Server Agent in Object Explorer as I don't have rights to do it. 而且我也无法从Object Explorer中的SQ L Server Agent创建作业,因为我没有这样做的权利。

So Is there any way to create job on server? 那么,有什么办法可以在服务器上创建作业吗?

You can do try two solutions: 您可以尝试以下两种解决方案:

Use a bat file that executes sqlcmd using the Windows built in scheduler. 使用使用Windows内置调度程序执行sqlcmd的bat文件。

or 要么

You can create an SSIS project that executes a sql step task and assign the proc to the SQL task.. Once again once you can use Windows scheduler to execute the SSIS package. 您可以创建一个执行sql步骤任务的SSIS项目,并将proc分配给SQL任务。再次可以使用Windows调度程序执行SSIS包。

Either one of these would take you around 1-2 hours to learn how to use the tools (if you have never done it before) and set up and use them. 这两种方法之一都将花费您大约1-2个小时来学习如何使用这些工具(如果您以前从未使用过)以及如何设置和使用它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM