dbTalk Databases Forums  

Stored procedure in Exec SQL Task

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Stored procedure in Exec SQL Task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
peterDavey
 
Posts: n/a

Default Stored procedure in Exec SQL Task - 03-17-2005 , 12:47 AM






G'day all,
I'm trying to use an Exec SQL task (SQL Server 2000) to run a stored
procedure and assign a message string returned by the proc to a global
variable. Here's the code:


DECLARE
@master_message VARCHAR(5000)
SET @master_message = ''

EXEC dbo.udp_IP_Update_Master @ov_output_message = @master_message OUTPUT

SELECT @master_message AS output_message

When I click the Parameters button in the Exec SQL Task properties dialogue,
I get a message saying that there are no parameters in the statement. If I
comment out the line with the EXEC statement, it then displays the
parameters dialogue and will let me map the output parameter
'output_message' to a global variable.

The code runs fine in query analyser. Anyone know what the problem could
be?

thanks

peterDavey
Austin Health
Melbourne



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Stored procedure in Exec SQL Task - 03-17-2005 , 03:04 AM






The design-time validation is too strict. You can workaround by using some
dummy SQL and then swap in the real code afterwards via Disconnected Edit
(There is a faster way but I forget, I'll look it up later).

More of an explanation of this
Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)

--
Darren Green
http://www.sqldts.com
http://www.sqlis.com
"peterDavey" <peter.davey (AT) austin (DOT) org.au> wrote

Quote:
G'day all,
I'm trying to use an Exec SQL task (SQL Server 2000) to run a stored
procedure and assign a message string returned by the proc to a global
variable. Here's the code:


DECLARE
@master_message VARCHAR(5000)
SET @master_message = ''

EXEC dbo.udp_IP_Update_Master @ov_output_message = @master_message OUTPUT

SELECT @master_message AS output_message

When I click the Parameters button in the Exec SQL Task properties
dialogue,
I get a message saying that there are no parameters in the statement. If
I
comment out the line with the EXEC statement, it then displays the
parameters dialogue and will let me map the output parameter
'output_message' to a global variable.

The code runs fine in query analyser. Anyone know what the problem could
be?

thanks

peterDavey
Austin Health
Melbourne





Reply With Quote
  #3  
Old   
peterDavey
 
Posts: n/a

Default Re: Stored procedure in Exec SQL Task - 03-17-2005 , 07:13 PM



Thanks Darren, I'll give it a try. In the meantime I've altered my proc to
insert the message into a table and this works pretty well also.
cheers
peterD

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
The design-time validation is too strict. You can workaround by using some
dummy SQL and then swap in the real code afterwards via Disconnected Edit
(There is a faster way but I forget, I'll look it up later).

More of an explanation of this
Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)

--
Darren Green
http://www.sqldts.com
http://www.sqlis.com
"peterDavey" <peter.davey (AT) austin (DOT) org.au> wrote in message
news:uJB$t0rKFHA.2136 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
G'day all,
I'm trying to use an Exec SQL task (SQL Server 2000) to run a stored
procedure and assign a message string returned by the proc to a global
variable. Here's the code:


DECLARE
@master_message VARCHAR(5000)
SET @master_message = ''

EXEC dbo.udp_IP_Update_Master @ov_output_message = @master_message
OUTPUT

SELECT @master_message AS output_message

When I click the Parameters button in the Exec SQL Task properties
dialogue,
I get a message saying that there are no parameters in the statement.
If
I
comment out the line with the EXEC statement, it then displays the
parameters dialogue and will let me map the output parameter
'output_message' to a global variable.

The code runs fine in query analyser. Anyone know what the problem
could
be?

thanks

peterDavey
Austin Health
Melbourne







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.