使用批处理文件在sql express edition中安排任务 [英] Schedule task in sql express edition using batch file

查看:97
本文介绍了使用批处理文件在sql express edition中安排任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要求 - 在SQL Express Edition中安排任务。



但是快递版中没有SQL Server代理功能。



可能的解决方案 - 安排批处理文件执行以执行sql脚本。试过



批处理文件 -

Requirements - Schedule task in SQL Express Edition.

But SQL server Agent functionality is not available in express edition.

Possible Solution- Schedule batch file execution to execute sql script. Tried

Batch File-

cmd /k sqlcmd -i backup.sql





Sql Script-



Sql Script-

backup database DB_user1212 to disk = 'E:\backups\MyBackup.bak'

。但执行sql脚本时发生错误

. But error occurred while executing sql script

A network related or instance specific error occurred while establishing a connection to SQL Server





可能的原因 - 缺少连接字符串。帮我解决这个问题,我使用windows身份验证进行连接。



Possible Reason- Something like connection string missing. Help me how to solve this, i am using windows authentication for connection.

推荐答案

Chetan Saini写道:
Chetan Saini wrote:

建立与SQL Server的连接时发生网络相关或特定于实例的错误

A network related or instance specific error occurred while establishing a connection to SQL Server




< a href =http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx>来自链接 [ ^ ]:

基本上,当您无法连接到SQL Server时,问题可能是:

1)网络问题,

2 )SQL Server配置问题。

3)防火墙问题,

4)客户端驱动程序问题,

5)应用程序配置问题。

6)身份验证和登录问题。

Basically, when you failed to connect to your SQL Server, the issue could be:
1) Network issue,
2) SQL Server configuration issue.
3) Firewall issue,
4) Client driver issue,
5) Application configuration issue.
6) Authentication and logon issue.

检查这些

解决SQL连接问题的步骤 [ ^ ]

SQL Server 2005连接问题疑难解答 - 第一部分 [ ^ ]

解决SQL Server 2005中的连接问题 - 第二部分 [ ^ ]

解决SQL Server 2005中的连接问题 - 第III部分 [ ^ ]

Check these
Steps to troubleshoot SQL connectivity issues[^]
SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^]


这篇关于使用批处理文件在sql express edition中安排任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆