Hi,
We have a custom query that runs a stored procedure. The stored procedure uses a token to do a search on a database, and then it inserts it into a "Results" table. The first the stored procedure does, however, is to delete all previous records inside that table. The problem is that after the stored procedure runs from workflow, it only deletes the records, but it doesn't add the results found. When we test the stored procedure on Management Studio, it works perfectly. We have tested it in workflow using the "Test" button on the Custom Query and manually typing in a test value we know works, but it still won't insert any results into the Results Table. This is how the custom query window looks like:
This is the exact code we use to run the stored procedure from the Custom Query activity:
USE [CSC_LF_Lookup_DB] DECLARE @return_value int, @VendorId int EXEC @return_value = [dbo].[FindVendor] @LongVendorName = N'@VendorName', @VendorId = @VendorId OUTPUT SELECT @VendorId as N'@VendorId' SELECT 'Return Value' = @return_value
So far, we know this:
- Stored procedure runs in workflow
- Stored procedure doesn't insert values found into table, despite using the same value in Management Studio to run that code and getting a result.
Any ideas?