dbTalk Databases Forums  

SSIS - Returning value from stored procedure with no parameters.

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


Discuss SSIS - Returning value from stored procedure with no parameters. in the microsoft.public.sqlserver.dts forum.



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

Default SSIS - Returning value from stored procedure with no parameters. - 01-17-2006 , 09:53 PM






I have a stored procedure that returns a smallint record and only one record.
How can I get SSIS to read that field... I'm using Execute SQL Task...

This is the stored procedure that I'm using which returns a record of 472:

CREATE PROCEDURE [Lookup].[GetAppelleeStyleID]
@StyleID SMALLINT OUTPUT
AS

SET @StyleID = (SELECT CONVERT(SMALLINT, Lookup.CaseLookup.CaseLookupID)
StyleID
FROM Lookup.CaseLookupGroup INNER JOIN
Lookup.CaseLookup ON Lookup.CaseLookupGroup.CaseLookupGroupID =
Lookup.CaseLookup.CaseLookupGroupID
WHERE
(Lookup.CaseLookupGroup.CaseLookupGroupDescription = 'Style')
AND (Lookup.CaseLookup.CaseLookupDescription = 'Appellee'))

I have tried creating the SQL task with a varialbe or using single row
resultset. Nothing is working.

Any assistance in the right direction is appreciated.

Reply With Quote
  #2  
Old   
scuba79
 
Posts: n/a

Default RE: SSIS - Returning value from stored procedure with no parameters. - 01-18-2006 , 10:31 AM






I finally figured it out... I set the resultset to None and created an OUTPUT
parameter in the parameter mapping and it worked....

"scuba79" wrote:

Quote:
I have a stored procedure that returns a smallint record and only one record.
How can I get SSIS to read that field... I'm using Execute SQL Task...

This is the stored procedure that I'm using which returns a record of 472:

CREATE PROCEDURE [Lookup].[GetAppelleeStyleID]
@StyleID SMALLINT OUTPUT
AS

SET @StyleID = (SELECT CONVERT(SMALLINT, Lookup.CaseLookup.CaseLookupID)
StyleID
FROM Lookup.CaseLookupGroup INNER JOIN
Lookup.CaseLookup ON Lookup.CaseLookupGroup.CaseLookupGroupID =
Lookup.CaseLookup.CaseLookupGroupID
WHERE
(Lookup.CaseLookupGroup.CaseLookupGroupDescription = 'Style')
AND (Lookup.CaseLookup.CaseLookupDescription = 'Appellee'))

I have tried creating the SQL task with a varialbe or using single row
resultset. Nothing is working.

Any assistance in the right direction is appreciated.

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

Default Re: SSIS - Returning value from stored procedure with no parameters. - 01-18-2006 , 03:28 PM



Hello scuba79,

You may also like to try

http://www.sqlis.com/default.aspx?58


allan

Quote:
I have a stored procedure that returns a smallint record and only one
record.
How can I get SSIS to read that field... I'm using Execute SQL
Task...
This is the stored procedure that I'm using which returns a record of
472:

CREATE PROCEDURE [Lookup].[GetAppelleeStyleID]
@StyleID SMALLINT OUTPUT
AS
SET @StyleID = (SELECT CONVERT(SMALLINT,
Lookup.CaseLookup.CaseLookupID)
StyleID
FROM Lookup.CaseLookupGroup INNER JOIN
Lookup.CaseLookup ON Lookup.CaseLookupGroup.CaseLookupGroupID =
Lookup.CaseLookup.CaseLookupGroupID
WHERE
(Lookup.CaseLookupGroup.CaseLookupGroupDescription = 'Style')
AND (Lookup.CaseLookup.CaseLookupDescription = 'Appellee'))
I have tried creating the SQL task with a varialbe or using single row
resultset. Nothing is working.

Any assistance in the right direction is appreciated.




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.