Input, Output and Return Values in SSIS Execute Sql Task

72
74294
return values

Friends,

In this post we are gonna discuss about all the THREE Parameter directions INPUT,OUTPUT and RETURN VALUE in Execute Sql Task. I am pretty sure that most of the SSIS developers might have used this task many times but at least few of them still not clear about how to use the three directions of Parameter and this post is for that set of people.

I can explain the INPUT direction by using any Sql Statement but to explain all the three Stored Procedure is the best option to choose. So, in this post I am gonna use SP to demonstrate the same.

I have created a damn simple SP with one parameter to demonstrate INPUT parameter and you can see the same in the below given SC.

Here I created a Stored Procedure “test” with a  Input Parameter @PrdKey

Now let’s see how to call the same in the Execute Sql Task.

1)     Drag and drop an Execute Sql Task to control flow and double click or right click and select Edit to set the properties.

2)     Once the properties wizard opens then set the connection to the database and use the following query for Sql Statement.

Exec test ?

3)     The ? in the above query means, it is a parameter for which the value will be assigned at runtime using variable.

 

4)     Now go to the Parameter Mapping page to map the parameter (variable) which will provide value to the “?” provided in the query.

5)     Under variable name select the variable which provides value to the query parameter.

6)     Under direction we will have THREE options and select INPUT as we are inputting the value to the parameter.

7)     Under datatype select the appropriate datatype and in this case I have selected LONG as the parameter for the SP.

8)    Under parameter Name property set 0 (Zero) as we have only one parameter in our query.

The parameter name values will be as given below –

? –> 0

?,? –> 0,1

?,?,? –> 0,1,2

The parameter name will be interger values starting from ZERO and it will be mapped in such a way that first ? will be replaced with first parameter (parameter name 0) and second one with second parameter ( parameter name 1) ….

9)     Now select OK and Execute.

10)  Now I created a SP with all the three values i.e Input Parameter, Output Parameter and also RETURN Value as shown below.

11)   Here @ProductKey is input , @ProductName is Output and “16” is Return Value parameter created stored procedure. Remember that SP can return ONLY Integer values.

12)  Now the query for this SP will be like given below in Execute Sql Task –

Exec ? = Test_sp ? , ? OUTPUT  

13) Here first ? is Return Value parameter, second ‘?’ Is Input parameter and third ‘?’ with OUTPUT keyword is output parameter

14)   Now Open Parameter Mapping and create Variable and Map it to the ‘?’ as explained above Section. Remember that the parameters assigning should follow sequence and in our example first one should be RETURN VALUE Parameter then INPUT and finally OUTPUT.

INPUT – Used for Input variables. The value will be passed from calling environment.

OUTPUT – Used for Output variable and value will be returned to calling environment.

RETURN VALUE – The value which is returned by SP.

15)  Here I created three variable Count for returnValue ,MinValue for Input and ProductName for the output and order them as 0,1,2 as per there occurrence.

16)  Click Ok and now we can pass values to the variables in the Variable window and run the package.

Note – We can configure OUTPUR (Result set) to return Table/XML/Single Row which will be discussed in next post.

Thanks a lot to Swati Srivastava for providing most of the content and SC to draft this post.

Regards,
Roopesh Babu V

72 COMMENTS

  1. ผ่านระบบการเล่นที่มีความล้ำยุค นำสมัย ไม่ว่าจะเป็นกราฟิกที่สวยงาม คมชัด มีเอกpgslot auto เกมสล็อตออนไลน์ใหม่ล่าสุด เกมเล่นฟรี เล่นง่ายผ่านมือถือ ลักษณ์เฉพาะตัว แต่ละเกมฟีเจอร์มีความหลากหลาย อัตราการจ่ายสูงโบนัสแตกบ่อย เป็นระบบใหม่ที่อัพเดทเมื่อไม่นานมานี้ มีค่ายเกมเล่นมากกว่า 10ค่ายเกม

  2. https://pragmaticplay-game.net/ Slot demo adalah alat yang sangat berguna bagi siapa saja yang ingin menikmati permainan slot online tanpa risiko finansial. Mereka memungkinkan pemain untuk belajar, berlatih, dan bersenang-senang tanpa harus mengeluarkan uang sungguhan. Jadi, jika Anda ingin mencoba keberuntungan Anda dan menemukan

  3. เว็บบาคาร่า http://www.wq888.live เป็นหนึ่งในเกมการพนัน ที่ได้รับความนิยมเป็นอย่างสูง ทั้งในประเทศไทยและทั่วโลก นั่นแสดงให้เห็นว่า บาคาร่านั้น สามารถทำเงิน จ่ายจริง ให้แก่ผู้เล่นได้เป็นอย่างดี และในปัจจุบันนั้น บาคาร่า ออนไลน์ และการพนัน คาสิโน เปิดให้บริการตลอด 24 ชั่วโมง ผ่านบาคาร่า เว็บตรง เพื่อให้นักลงทุนนั้นสามารถเข้าถึงได้ง่าย สะดวกและรวดเร็ว พร้อมที่จะลงทุนได้ทุกเวลา

  4. เว็บแทงบอล ออนไลน์อันดับหนึ่ง เว็บแทงบอลที่ดีที่สุดในปี 2024 สุดยอดเว็บแทงบอลออนไลน์มาแรงที่สุดในปีนี้ เว็บที่ได้รับมาตรฐานจากทาง sbobet โดยตรงจากต่างประเทศ เว็บแทงบอลใหม่ล่าสุด ทางเรายังเป็นเว็บอันดับหนึ่ง ของประเทศไทย และ ชั้นนำของเอเชีย แทงบอลออนไลน์ ที่เปิดมาแล้วถึง 30 ปี เว็บของเรา สโบเบ็ต เป็นเว็บที่แทงบอลได้ทุกรูปแบบ

  5. pg slot เว็บตรง เป็นผู้ให้บริการสล็อตออนไลน์เว็บตรง จากต่างประเทศ ที่ได้รับมาตรฐานระดับสากล เพื่อมอบความสนุกให้กับผู้ใช้งานและสามารถทำเงินได้จริง ไม่ผ่านเอเย่นต์ ไร้กังวล ฝากและถอนเร็วทันใจ เว็บแท้โบนัสแตกง่าย แตกจริง รวมเกมจากค่ายดังทั่วโลกไว้ในที่เดียว ผ่านการเล่นบนระบบที่ดีที่สุดในปี 2024

  6. pgxo พวกเราคือ สล็อตเว็บตรง ไม่ผ่านเอเย่นต์ ให้บริการโดยคนไทยแท้ ๆ มีทีมงานมืออาชีพคอยให้บริการตลอด 24 ชั่วโมง pg slot เว็บใหญ่ มาตรฐานการให้บริการระดับสากล ฝาก-ถอน เร็วที่สุด

  7. Voor de echte zoetekauwen onder ons is het spel Sugar Rush zeker de moeite waard om op te zoeken. Ontdek lekkere snoepjes en geniet van zoete tussendoortjes. Het thema van deze zoetsappige gokkast is erg goed uitgewerkt door spel provider Pragmatic Play. Je krijgt op de achtergrond van het spel een landschap te zien van zoetigheid. Wolken van slagroom, puddingen als bergen, rivieren van vla en ga zo maar door. Overal waar je kijkt, zie je snoepjes voorbij komen en de omgeving ziet er eerlijkwaar prachtig uit. Het speelveld wordt omringd door een snoepjesmachine. Laten we eens kijken of Sugar Rush ons net zo blij kan maken als een lekkere reep chocola. Zoetekauw? Zet je tanden eens in Sugar Rush 1000. Deze nieuwe gokkast van Pragmatic Play is net zo zoet als zijn populaire voorganger, alleen smaakt het nog beter. Met dank aan een upgrade van de RTP en belangrijkste features. Hierover en meer lees je in deze Sugar Rush 1000 slot review; het ideale aperitief voor je toegeeft aan je suikerdrang.
    https://joicleethlotig1972.raidersfanteamshop.com/citaat
    Scheepjes Maxi Sweet Treat en Scheepjes Maxi Sugar Rush zijn hoogwaardige, gemerceriseerde garens van 100% katoen met een fijne garendikte (Lace). Deze garens hebben een subtiele glans en een sterk getwijnde draad, wat zorgt voor een prachtige, gladde afwerking van je brei- of haakwerk. Dankzij de fijne structuur zijn deze garens ideaal voor opengewerkte patronen zoals ajourbreien, kantbreien of filethaakwerk. Ze zijn ook perfect voor het maken van luchtige kledingstukken en accessoires. Geef je nieuwe verlanglijst hieronder een naam. Afhalen van uw bestelling is mogelijk dit kan na het bestellen en betalen via de site. Betizy is een nieuw online casino zonder Cruks, waar ook Nederlandse spelers van harte welkom zijn. Hier ontvangen nieuwe spelers een heerlijke welkomstbonus tot wel €10.000, wat het een toegankelijk casino maakt voor zowel de beginnende spelers als de high roller. Hoewel Betizy zich voornamelijk richt op sportwedstrijden zoals voetbal, tennis en basketbal hoeven de casinoliefhebbers zich hier absoluut niet te vervelen. Met bijna 4000 casino spellen is er elke dag wel iets te beleven en krijg je met de welkomstbonus ook nog eens extra winkans!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

one + = 6