• ian.gregson (2/14/2011)


    Hi Solomon, thanks for the reply but I didn't really want to execute the sproc in its entirety.

    These output column names are what I want to build my test around but I can't figure out a way of grabbing them within a test.

    Hi Ian. There is no way that I can think of to just grab the result set column names.

    However, if you want to run the Proc with all parameters set to NULL, then just run it in an Execute while setting the variables to NULL, such as:

    !|Execute| CREATE TABLE #ResultSetTest (ColA INT, ColB VARCHAR(50), ColC DATETIME) |

    !|Execute| INSERT INTO #ResultSetTest EXEC Test.dbo.TestProc NULL, NULL, NULL |

    Or you can try setting the session property FMTONLY:

    !|Execute| CREATE TABLE #ResultSetTest (ColA INT, ColB VARCHAR(50), ColC DATETIME) |

    !|Execute| SET FMTONLY ON |

    !|Execute| INSERT INTO #ResultSetTest EXEC Test.dbo.TestProc NULL, NULL, NULL |

    !|Execute| SET FMTONLY OFF |

    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