通过sql server作业打开网页 [英] To open a web page through sql server job
问题描述
你好,
我想在sql服务器上创建作业以按计划的时间打开网页,我该怎么做,我对sql作业不是很熟悉,我尝试了一些示例,但没有成功.请尽快帮助我.在此先感谢
Hello,
I want to create a job in sql server to open a web page on scheduled time how can i do it, i m not much familiar with sql jobs, i tried some examples but i have not got success. Please help me as soon as possible. Thanks in advance
推荐答案
据我所知,没有直接的sql命令可用于打开网页
所以,我建议了另一种方式
您可以尝试通过这种方式达到要求
第1步.首先创建具有网页网址的批处理文件
As per my knowledge no direct sql-command is available to open webpage
so, i have suggested another way
you can try to achieve requirement this way
step 1.first of all create batch file,having url of webpage
START "http://www.google.com"
(将此行放入批处理文件中并保存)
第2步现在,
打开sql并运行此查询
(put this line in batch file and save this)
step 2Now,
open sql and run this query
EXEC master..xp_CMDShell 'C:\Users\...\Desktop\a.bat'
第3步
如果这两个步骤均成功完成.
然后创建将执行上述sqlcommand的SQL作业
sql->对象资源管理器-> sql服务器代理->新->作业(根据要求指定作业任务详细信息)
第3步的另一个选择是
设置pc中的scheduleTask,它将在指定时间执行批处理文件
开始->程序->配件->系统工具->然后是计划任务.
祝您编码愉快!
:)
step 3
if this both steps worked successfully.
then create SQL-job that will execute sqlcommand described above
sql-> object explorer-> sql server agent-> new -> job(specify job task details as per requirement)
another Option of step 3 is
to set scheduleTask in pc, which will execute batch file on specified time
start-> Program-> Accessories-> System Tools-> then Scheduled Tasks.
Happy Coding!
:)
这篇关于通过sql server作业打开网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!