NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use stored procedures in TestStand

I am trying to run a stored procedure but always get the error:

Error executing substep 'Post'.
The following SQL command failed: 'EXEC dbo.sp_test...'
Native error code -2147217887 0x80040e21
Microsoft OLE DB Provider for SQL Server:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
0 Kudos
Message 1 of 3
(3,830 Views)
I have successfully run stored procedures in Oracle from TestStand. Make sure your connection settings are right. Make sure your parameters to the stored procedure match the type expected. The Oracle Number type matches to the TestStand Numeric type. Oracle Timestamps are strings in TestStand. Run a separate SQL program to verify that the stored procedure works properly. I've had trouble with stored procedure and undefined or NULL values for some parameters. Make sure all parameters are defined to some value. I don't know what else to check, hope one of these will help you solve your problem.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 3
(3,830 Views)
NI_jc,

> I am trying to run a stored procedure but always get the error:
>
> Error executing substep 'Post'.
> The following SQL command failed: 'EXEC dbo.sp_test...'
> Native error code -2147217887 0x80040e21
> Microsoft OLE DB Provider for SQL Server:
> Multiple-step OLE DB operation generated errors. Check each OLE DB
> status value, if available. No work was done.

In my dealings with TestStand and SQL, such errors are ~usually~ related to
either security permissions or the parameters passed to the stored
procedure.

Can you successfully run the stored procedure from SQL Query Analyzer using
the same username and password (and other connection info) that you use in
the DataLink used in TestStand?

If so, I would then look at the parameters you are passin
g to the stored
procedure. Verify you are passing the correct number and correct data types
for each parameter the stored proc expects.

If that all checks out, double check that you are using the correct
connection handle, etc.

Good luck,

---
Bob
0 Kudos
Message 3 of 3
(3,830 Views)