You are viewing limited content. For full access, please sign in.

Question

Question

Stored Procedure runs in sql server manager, but gives errors in workflow

asked on June 2, 2014

 There was a similar case for this last month,but I'm not having any luck.

 

I've dumbed down the query to the point where it doesn't have any parameters passed on workflows end by including it in the query:

 

USE [Database]
GO

DECLARE	@return_value int

EXEC	@return_value = [dbo].[lf_case_lock_retrieve]
		@casenum = N'11-22222',
		@userid = N'laserfiche'

SELECT	'Return Value' = @return_value

GO

When I run this on sql server manager, I'm getting results.

 

When I run this as a custom query in workflow and try to test, I'm getting "Incorrect syntax near GO twice. 

0 0

Replies

replied on June 2, 2014

How is your data source set up?

1 0
replied on June 2, 2014

I was actually asking if you're using the ODBC driver in the data source setup, but your screenshot answered the question (you are).

 

I think it will work as you want it if you remove both "GO".

1 0
replied on June 2, 2014

To be honest, I don't have complete access to write to it except through stored procedures. 

 

 

However as a test I did the following:

 

I created a new table:

 

I then created a simple stored procedure:

 

I then tested my stored procedure:

 

 

I then copied this to workflow:

 

then I clicked test to run:

 

 

So I appear to be getting the same error. I am assuming I'm calling the stored procedure incorrectly?

0 0
replied on June 2, 2014 Show version history

Miranda,

 

Well, I'm getting further.

 

Now it's executing but I'm having trouble passing in parameters. 

 

When I run with hardcoded parameters without the GO it's running fine. However, consider the following, paying attention to the @casenum line:

 

 

 

 

 

for each of the below, I substituted one line to attempt to pass parameters: 

 

In row1 I used   @casenumber = N'?',      and it came back with ?.

 

In row 2 I used @casenumber = N?,      and it came back with N@P! 

 

In row 3 I used @casenumber = ?,     and I used N'14-23780' as the parameter value. 

 

 

 

Obviously I'm trying to place just the 14-23780 in that column. Any ideas?

0 0
replied on June 2, 2014

Do you need the 'N'? You're possibly running into http://support.microsoft.com/kb/293659

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.