在Windows任务计划程序中使用sqlcmd.exe

时间:2022-12-20 02:17:25

I want to push data from one server to another using Task Scheduler and by sqlcmd. Here is the argument i use for

我想使用Task Scheduler和sqlcmd将数据从一台服务器推送到另一台服务器。这是我用来的论据

sqlcmd.exe :- -S "Server IP,Port No\SQLSERVER" -U username -P password -d 
database -Q "exec data_export" 

The server where I want to push uses a custom port.

我想要推送的服务器使用自定义端口。

Currently, I'm using data_export procedure manually. But I want to do it automatically using Task Scheduler.

目前,我手动使用data_export程序。但我想使用任务计划程序自动完成。

在Windows任务计划程序中使用sqlcmd.exe

1 个解决方案

#1


0  

Then your syntax should be something like this:

那你的语法应该是这样的:

sqlcmd -S SERVER\INSTANCE,PORT -U username -P password -d database -Q "exec data_export"

Have you tried this?

你试过这个吗?

And one more thing, when you config this in the task scheduler, you need to write sqlcmd in the field "Program/Script" as shown in your image. And all the rest of the command should be set in the field "Add Arguments".

还有一件事,当您在任务计划程序中进行配置时,您需要在“程序/脚本”字段中编写sqlcmd,如图所示。并且应该在“Add Arguments”字段中设置命令的所有其余部分。

#1


0  

Then your syntax should be something like this:

那你的语法应该是这样的:

sqlcmd -S SERVER\INSTANCE,PORT -U username -P password -d database -Q "exec data_export"

Have you tried this?

你试过这个吗?

And one more thing, when you config this in the task scheduler, you need to write sqlcmd in the field "Program/Script" as shown in your image. And all the rest of the command should be set in the field "Add Arguments".

还有一件事,当您在任务计划程序中进行配置时,您需要在“程序/脚本”字段中编写sqlcmd,如图所示。并且应该在“Add Arguments”字段中设置命令的所有其余部分。