09-10-2010 11:34 AM
Hi All,
I have problems to use TestStand Database step types to execute a MS SQL stored procedure
I used Open SQL Statement step with SQL Statement as
"spStoredProcedure @parameter1 = 'A', @parameter2 = 'B';"
or "spStoredProcedure 'A', 'B';" or "EXEC spStoredProcedure @parameter1 = 'A', @parameter2 = 'B';"
But none of them return back the recordset, the number of records returned is always -1
I use "Use Default" for all options under Advanced tab.
The stored procedure works fine within SQL Studio or LabVIEW for all expressions. If I replace "spStoredProcedure @parameter1 = 'A', @parameter2 = 'B';" with the real contents of the stored procedure, the Open SQL Statement step returns back the correct records number.
I never have this problem with My SQL (ODBC drivers). Can somebody correct me or give me an example to execute a MS SQL stored procedure with parameter
09-10-2010 11:49 AM
I also tried another stored procedure with no parameters, the record number is still -1.
TestStand 4.2.1; MS SQL Server 2005/2008 R2
09-11-2010 10:44 AM
Why are you not selecting 'Stored Procedure' as the command type?
09-11-2010 12:04 PM
I did. The Number of Records Selected still returns -1.
For My SQL, I use "Use Default" for all settings, and it works fine.
For MS SQL, I've tried various combinations, none of them work.