• Alexander Kuznetsov (11/13/2008)


    Solomon Rutzky (11/13/2008)


    Alexander Kuznetsov (11/13/2008)


    How would you test the following cases:

    - my stored procedure modifies two tables and returns a result set;

    3) To test any result set, use either the "Query" or "Ordered Query" operations. It does not matter what else the Stored Procedure does.

    IMO yes it does - how do you verify that the modifications are exactly as you expect?

    Ok, sorry, I misunderstood the intent of that question. To test both the modifications made in the Stored Procedure and the result set returned, you would do the following all within the same page:

    a) use the "Query" operation calling EXEC on the Stored Procedure to test the result set

    b) use the "Query" operation again calling SELECT * FROM Table1 to test that change

    c) use the "Query" operation again calling SELECT * FROM Table2 to test that change

    If you look at the http://localhost:8085/DemoSuite.ExecuteAndExecuteProcedure example, this scenario is shown by the first test on that page which inserts into a table via a Stored Procudure and captures its result set:

    EXEC DBFitTest_Insert 'Mark Robinson', ' Orange ', 0

    and then the third test does:

    SELECT * FROM DBFitTest WHERE TestID = @Bridget

    Hope this helps. Take care, Solomon......

    SQL#https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
    Sql Quantum Lifthttps://SqlQuantumLift.com/ ( company )
    Sql Quantum Leaphttps://SqlQuantumLeap.com/ ( blog )
    Info sitesCollations     •     Module Signing     •     SQLCLR