<bdo id='dMPtf'></bdo><ul id='dMPtf'></ul>

    1. <i id='dMPtf'><tr id='dMPtf'><dt id='dMPtf'><q id='dMPtf'><span id='dMPtf'><b id='dMPtf'><form id='dMPtf'><ins id='dMPtf'></ins><ul id='dMPtf'></ul><sub id='dMPtf'></sub></form><legend id='dMPtf'></legend><bdo id='dMPtf'><pre id='dMPtf'><center id='dMPtf'></center></pre></bdo></b><th id='dMPtf'></th></span></q></dt></tr></i><div id='dMPtf'><tfoot id='dMPtf'></tfoot><dl id='dMPtf'><fieldset id='dMPtf'></fieldset></dl></div>
      <tfoot id='dMPtf'></tfoot>
      <legend id='dMPtf'><style id='dMPtf'><dir id='dMPtf'><q id='dMPtf'></q></dir></style></legend>

    2. <small id='dMPtf'></small><noframes id='dMPtf'>

        不使用游标的每一行的 SQL 调用存储过程

        SQL Call Stored Procedure for each Row without using a cursor(不使用游标的每一行的 SQL 调用存储过程)
        <i id='xEBoc'><tr id='xEBoc'><dt id='xEBoc'><q id='xEBoc'><span id='xEBoc'><b id='xEBoc'><form id='xEBoc'><ins id='xEBoc'></ins><ul id='xEBoc'></ul><sub id='xEBoc'></sub></form><legend id='xEBoc'></legend><bdo id='xEBoc'><pre id='xEBoc'><center id='xEBoc'></center></pre></bdo></b><th id='xEBoc'></th></span></q></dt></tr></i><div id='xEBoc'><tfoot id='xEBoc'></tfoot><dl id='xEBoc'><fieldset id='xEBoc'></fieldset></dl></div>

        <small id='xEBoc'></small><noframes id='xEBoc'>

          <tbody id='xEBoc'></tbody>
        <legend id='xEBoc'><style id='xEBoc'><dir id='xEBoc'><q id='xEBoc'></q></dir></style></legend>

            • <tfoot id='xEBoc'></tfoot>
              • <bdo id='xEBoc'></bdo><ul id='xEBoc'></ul>
                  本文介绍了不使用游标的每一行的 SQL 调用存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何为表中的每一行调用存储过程,其中一行的列是 sp 使用游标的输入参数?>

                  How can one call a stored procedure for each row in a table, where the columns of a row are input parameters to the sp without using a Cursor?

                  推荐答案

                  一般来说,我总是寻找基于集合的方法(有时以更改架构为代价).

                  Generally speaking I always look for a set based approach (sometimes at the expense of changing the schema).

                  然而,这个片段确实有它的位置..

                  However, this snippet does have its place..

                  -- Declare & init (2008 syntax)
                  DECLARE @CustomerID INT = 0
                  
                  -- Iterate over all customers
                  WHILE (1 = 1) 
                  BEGIN  
                  
                    -- Get next customerId
                    SELECT TOP 1 @CustomerID = CustomerID
                    FROM Sales.Customer
                    WHERE CustomerID > @CustomerId 
                    ORDER BY CustomerID
                  
                    -- Exit loop if no more customers
                    IF @@ROWCOUNT = 0 BREAK;
                  
                    -- call your sproc
                    EXEC dbo.YOURSPROC @CustomerId
                  
                  END
                  

                  这篇关于不使用游标的每一行的 SQL 调用存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                    <tfoot id='nq5Eu'></tfoot>
                      <tbody id='nq5Eu'></tbody>

                    <small id='nq5Eu'></small><noframes id='nq5Eu'>

                  • <i id='nq5Eu'><tr id='nq5Eu'><dt id='nq5Eu'><q id='nq5Eu'><span id='nq5Eu'><b id='nq5Eu'><form id='nq5Eu'><ins id='nq5Eu'></ins><ul id='nq5Eu'></ul><sub id='nq5Eu'></sub></form><legend id='nq5Eu'></legend><bdo id='nq5Eu'><pre id='nq5Eu'><center id='nq5Eu'></center></pre></bdo></b><th id='nq5Eu'></th></span></q></dt></tr></i><div id='nq5Eu'><tfoot id='nq5Eu'></tfoot><dl id='nq5Eu'><fieldset id='nq5Eu'></fieldset></dl></div>

                          <legend id='nq5Eu'><style id='nq5Eu'><dir id='nq5Eu'><q id='nq5Eu'></q></dir></style></legend>
                            <bdo id='nq5Eu'></bdo><ul id='nq5Eu'></ul>