积极答复者
如果让作业并发执行,谢谢!

问题
答案
-
直接创建两个task,你可以参考一下这个:https://www.cnblogs.com/java-oracle/p/6414411.html,然后JOB里面选择SSIS,如下图:
如果没用过SSIS,上手可能要一点时间,你也可以换一种方法,用CLR Parallel Execution,https://www.codeproject.com/Articles/29356/Asynchronous-T-SQL-Execution-Without-Service-Broke
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已标记为答案 Tim-2009 2019年1月28日 7:18
全部回复
-
好像有难以表述的原因一样
合理拆分作业,设置标志位(存储在表里)去控制就好
SQL Server 2016 ~ 2000 性能优化、方案设计 QQ:315054403 田园嘉兴
- 已建议为答案 Teige GaoModerator 2018年8月14日 9:52
-
Hi Tim-2009,
根据你描述的,你的意思是需要在“这个存储过程分别调用AB上各个数据库的某个存储过程”这个过程中让AB两个数据库的存储过程同时执行?是吗?
如果是这样的话,只用一个JOB跑T-SQL语句比较难,step都是顺序执行的,推荐使用SSIS,把这些步骤封装在里面,然后跑这个包,SSIS的包可以并行运行,而且只需要一个JOB。
Best Regards,
Teige
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com. -
Hi Tim-2009,
根据你描述的,你的意思是需要在“这个存储过程分别调用AB上各个数据库的某个存储过程”这个过程中让AB两个数据库的存储过程同时执行?是吗?
如果是这样的话,只用一个JOB跑T-SQL语句比较难,step都是顺序执行的,推荐使用SSIS,把这些步骤封装在里面,然后跑这个包,SSIS的包可以并行运行,而且只需要一个JOB。
Best Regards,
Teige
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
是这个意思,关于SSIS怎么封装并在JOB中运行有相关资料吗?以前没用过SSIS,谢谢! -
直接创建两个task,你可以参考一下这个:https://www.cnblogs.com/java-oracle/p/6414411.html,然后JOB里面选择SSIS,如下图:
如果没用过SSIS,上手可能要一点时间,你也可以换一种方法,用CLR Parallel Execution,https://www.codeproject.com/Articles/29356/Asynchronous-T-SQL-Execution-Without-Service-Broke
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已标记为答案 Tim-2009 2019年1月28日 7:18
-
直接创建两个task,你可以参考一下这个:https://www.cnblogs.com/java-oracle/p/6414411.html,然后JOB里面选择SSIS,如下图:
如果没用过SSIS,上手可能要一点时间,你也可以换一种方法,用CLR Parallel Execution,https://www.codeproject.com/Articles/29356/Asynchronous-T-SQL-Execution-Without-Service-Broke
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.我根据我这边的实际情况,把第一段代码中运行插入数据表的语句改成调用我这边数据库的存储过程,执行报错,请问这是什么原因?
Parallel_SetOption_CommandTimeout设置成了0
error_s没显示全的是三个表名(存储过程print出来的几个表名)
error_stack没显示全的信息如下:
System.Data.SqlClient.SqlException: 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) 在 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) 在 System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) 在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) 在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() 在 SqlClrLib.Model.ThreadSql.ExecuteSql(String connectionString, String sql, Int32 commandTimeout, DependentTransaction dtx)- 已编辑 Tim-2009 2018年8月15日 9:11 更改描述