dbTalk Databases Forums  

Exec SQL - Stored procedure output parameter

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


Discuss Exec SQL - Stored procedure output parameter in the microsoft.public.sqlserver.dts forum.



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

Default Exec SQL - Stored procedure output parameter - 04-04-2005 , 07:03 PM






Hi,

I am using a stored proc which takes three input parameters based on which
it would identify the table, and fetch the rowcount of the table before
delete and execute a delete command on some condition and perform again a
rowcount

The SP returns two output parameters of type int.

create mystoredproc
@a varchar(30),
@b varchar(30),
@c varchar(30),
@d int output,
@e int output
Begin
.....
End.

Problem:
I use a dts package, Exec SQL task and pass the input parameters via global
variables. The output variables are not set to the return value of the
stored procedure.

Whereas I run the same stored proc, declaring necessary variables in Query
Analyser, I am able to get the right results???
I have used disconnected edit to set the input and output parameters of the
Exec SQL task in the dts package.

Any reason, why the return values are not set...

Thanks
SatishTL


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Exec SQL - Stored procedure output parameter - 04-05-2005 , 01:04 PM






Have you had a look here?

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"SatishTL" <SatishTL (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I am using a stored proc which takes three input parameters based on which
it would identify the table, and fetch the rowcount of the table before
delete and execute a delete command on some condition and perform again a
rowcount

The SP returns two output parameters of type int.

create mystoredproc
@a varchar(30),
@b varchar(30),
@c varchar(30),
@d int output,
@e int output
Begin
....
End.

Problem:
I use a dts package, Exec SQL task and pass the input parameters via
global
variables. The output variables are not set to the return value of the
stored procedure.

Whereas I run the same stored proc, declaring necessary variables in Query
Analyser, I am able to get the right results???
I have used disconnected edit to set the input and output parameters of
the
Exec SQL task in the dts package.

Any reason, why the return values are not set...

Thanks
SatishTL




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

Default Re: Exec SQL - Stored procedure output parameter - 04-05-2005 , 03:05 PM



Thanks Allan, it helped me to resolve the issue.

Thanks
SatishTL

"Allan Mitchell" wrote:

Quote:
Have you had a look here?

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"SatishTL" <SatishTL (AT) discussions (DOT) microsoft.com> wrote in message
news:4B20EEAC-B134-49BE-ADF6-291293A795AA (AT) microsoft (DOT) com...
Hi,

I am using a stored proc which takes three input parameters based on which
it would identify the table, and fetch the rowcount of the table before
delete and execute a delete command on some condition and perform again a
rowcount

The SP returns two output parameters of type int.

create mystoredproc
@a varchar(30),
@b varchar(30),
@c varchar(30),
@d int output,
@e int output
Begin
....
End.

Problem:
I use a dts package, Exec SQL task and pass the input parameters via
global
variables. The output variables are not set to the return value of the
stored procedure.

Whereas I run the same stored proc, declaring necessary variables in Query
Analyser, I am able to get the right results???
I have used disconnected edit to set the input and output parameters of
the
Exec SQL task in the dts package.

Any reason, why the return values are not set...

Thanks
SatishTL





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.