Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Easy and Repeatable Testing of DB Code (Stored Procs, etc.) with DbFit Expand / Collapse
Author
Message
Posted Monday, February 14, 2011 3:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 17, 2012 5:22 AM
Points: 2, Visits: 43
Hi Solomon, thanks for the reply but I didn't really want to execute the sproc in its entirety. Some of our report sprocs are complex and can take up to 40 seconds to complete.
I was using the DBfit 'Inspect Query' command to execute the sproc with NULL variables as this instantly returns the 'result set' structure (the output column names) and not the actual 'result set' data.

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.
Post #1063385
Posted Monday, February 14, 2011 8:12 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 6:35 PM
Points: 368, Visits: 1,942
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# - http://www.SQLsharp.com/
Post #1063551
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse