简体   繁体   English

使用 T-SQL 查询和 SSIS 中的存储过程执行 SQL 任务

[英]Execute SQL task with T-SQL query and with stored procedure in SSIS

In SSIS Execute SQL Task currently I am calling a stored procedure and inside the procedure I have a MERGE statement.在 SSIS 执行 SQL 任务中,目前我正在调用存储过程,并且在过程中我有一个 MERGE 语句。

Is there any difference if I call that query (T-SQL MERGE) directly in the Execute SQL Task?如果我直接在执行 SQL 任务中调用该查询(T-SQL MERGE),有什么区别吗? (are there any differences like Log will create if we used SP?) (如果我们使用 SP,Log 会产生什么差异吗?)

Please reply me...请回复我...

Thanks in advance提前致谢

Stored procedure will provide you with a more maintainable solution as you will be able to leverage code reuse and there will be no need to change / re-release the package if your query logic changes存储过程将为您提供更易于维护的解决方案,因为您将能够利用代码重用,并且如果您的查询逻辑发生更改,则无需更改/重新发布 package

A stored procedure is also likely to provide you with the fastest execution time as it will be compiled and the execution plan will be reused on subsequent runs存储过程也可能为您提供最快的执行时间,因为它将被编译并且执行计划将在后续运行中重用

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

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