how to call a stored procedure in SSIS<p>I have to transfer data from source to destination using stored procedures result  set.  There might be some more transformation needed to store the final result in the destination table.</p> <p>Appreciate an early feedback.</p> <p>Qadir Syed</p> <p> </p>© 2009 Microsoft Corporation. All rights reserved.Fri, 03 Apr 2009 16:34:09 Zee686cf8-0880-4a1d-8706-ba72fbb2eba8http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#ee686cf8-0880-4a1d-8706-ba72fbb2eba8http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#ee686cf8-0880-4a1d-8706-ba72fbb2eba8qadirsyedhttp://social.msdn.microsoft.com/Profile/en-US/?user=qadirsyedhow to call a stored procedure in SSIS<p>I have to transfer data from source to destination using stored procedures result  set.  There might be some more transformation needed to store the final result in the destination table.</p> <p>Appreciate an early feedback.</p> <p>Qadir Syed</p> <p> </p>Fri, 21 Jul 2006 17:35:59 Z2007-05-28T21:28:48Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#7a67463a-d8c6-43e6-9a66-faca7d12cb7chttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#7a67463a-d8c6-43e6-9a66-faca7d12cb7cGlenn Wellingtonhttp://social.msdn.microsoft.com/Profile/en-US/?user=Glenn%20Wellingtonhow to call a stored procedure in SSIS<p>Just create a new instance of &quot;OLE DB Command&quot;.</p> <p>Pick and choose your connection, and call the command as exec &lt;procedure name&gt; </p>Fri, 21 Jul 2006 17:44:22 Z2006-07-21T17:44:22Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#18d07a85-40d1-42e5-8814-e501127463c0http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#18d07a85-40d1-42e5-8814-e501127463c0Mallikarjun n Channappagoudrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Mallikarjun%20n%20Channappagoudrahow to call a stored procedure in SSIS &quot;Oledb command&quot; Source executes stored procedures.But it does not recognize the output  of the stored procedure.<br>If I have a select statement at the end of the Stored procedure that returns me some columns,then those columns are not recognized by &quot;OLEDB Command&quot; as out put columns.<br><br><br><br>Is there any advice for executing such stored procedure?<br>Fri, 11 May 2007 08:04:28 Z2007-05-11T08:04:28Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#d4e4275c-4e4f-4104-81f2-6747a3bad88bhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#d4e4275c-4e4f-4104-81f2-6747a3bad88bjaegdhttp://social.msdn.microsoft.com/Profile/en-US/?user=jaegdhow to call a stored procedure in SSISUse a no-op select statement to &quot;declare&quot; metadata to the pipeline.  Since stored procedures don't publish rowset meta-data like tables,views and table-valued functions, the first select statement of a stored procedure is used by the SQLClient OLEDB provider to determine column metadata.<br><br> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div> <p>CREATE PROCEDURE dbo.GenMetadata<br>AS<br>    SET NOCOUNT ON <br>    <br>   IF 1 = 0<br>   BEGIN<br>       SELECT CAST(1 as smallint) as Fake<br>       -- Publish metadata<br>    END<br>    <br>    -- do real work starting here<br>    DECLARE @x char(1)<br>    SET @x = (SELECT '1')<br>    <br>    <br>    SELECT cast(@x as smallint)<br>    <br>    RETURN</p></div></div><br><br><br><br><br><br>Fri, 11 May 2007 09:59:24 Z2007-05-28T21:28:48Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#3e59794a-366b-4653-b3e5-30a82e0c6fd4http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#3e59794a-366b-4653-b3e5-30a82e0c6fd4LittleBullhttp://social.msdn.microsoft.com/Profile/en-US/?user=LittleBullhow to call a stored procedure in SSISjaegd - thanks!!!Mon, 28 May 2007 21:25:29 Z2007-05-28T21:25:29Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#6188d590-bcd3-410d-88f6-170f603f6ea5http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#6188d590-bcd3-410d-88f6-170f603f6ea5Mallikarjun n Channappagoudrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Mallikarjun%20n%20Channappagoudrahow to call a stored procedure in SSISIt does not work If there are more than one rows are coming out of stored procedure.<br><br><br><br>Thu, 28 Jun 2007 08:34:50 Z2007-06-28T08:34:50Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#2028a1d9-50e7-4b45-ba09-920b7c14c1e1http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#2028a1d9-50e7-4b45-ba09-920b7c14c1e1Mallikarjun n Channappagoudrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Mallikarjun%20n%20Channappagoudrahow to call a stored procedure in SSISI got  it solved on my end by replacing all temporary tables by temporary variables.<br> <br>Thu, 28 Jun 2007 08:37:44 Z2007-06-28T08:37:44Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#2cf51282-f866-4a0c-868d-510f3f786c1ehttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#2cf51282-f866-4a0c-868d-510f3f786c1ejaegdhttp://social.msdn.microsoft.com/Profile/en-US/?user=jaegdhow to call a stored procedure in SSIS<p>Please give an example of what doesn't work for you.</p>Thu, 28 Jun 2007 08:50:13 Z2007-06-28T08:50:13Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#ea5601fd-8ee5-4e35-9026-c191bd26eef4http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#ea5601fd-8ee5-4e35-9026-c191bd26eef4Mallikarjun n Channappagoudrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Mallikarjun%20n%20Channappagoudrahow to call a stored procedure in SSISIn the above post it should be table variable not temporary variable.<br><br>Conclusion:<br><span style="font-weight:bold;color:rgb(0,0,0)">It was table variable that Used instead of temporary table.</span><br><br>Fri, 29 Jun 2007 09:13:59 Z2007-06-29T09:13:59Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#336ef9b9-3b30-4bfa-85f8-e8ad87f5b453http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#336ef9b9-3b30-4bfa-85f8-e8ad87f5b453Mallikarjun n Channappagoudrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Mallikarjun%20n%20Channappagoudrahow to call a stored procedure in SSISHey try with the example below<br><br>CREATE PROCEDURE dbo.GenMetadata<br>AS<br>SET NOCOUNT ON<br>CREATE TABLE #test(<br>[id] [int] NULL,<br>[Name] [nchar](10) NULL,<br>[SirName] [nchar](10) NULL<br>) ON [PRIMARY]<br><br><br>INSERT INTO #test<br>SELECT '1','A','Z' union all select '2','b','y'<br><br>select id,name,SirName <br>from #test<br>drop table #test<br>RETURN<br><br>Please let me know the result.<br>Fri, 29 Jun 2007 09:51:01 Z2007-06-29T09:51:01Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#62b3af56-14bb-45bf-87e8-0b173506c31bhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#62b3af56-14bb-45bf-87e8-0b173506c31bjaegdhttp://social.msdn.microsoft.com/Profile/en-US/?user=jaegdhow to call a stored procedure in SSIS<p>With a local temp table created in the stored procedure, <span>use a no-op select statement to &quot;declare&quot; metadata to the pipeline.  </span></p> <p><span></span> </p> <p><span></span> </p><span><font color="#0000ff" size=2> <p> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Snippet</span></div><span><font color="#0000ff" size=2><font color="#0000ff" size=2></font><font size=2> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;color:blue;font-family:Consolas">IF</span><span style="font-size:8pt;font-family:Consolas"><font color="#000000"> </font><span style="color:fuchsia">OBJECT_ID</span><span style="color:gray">(</span><span style="color:red">'[dbo].[GenMetadata]'</span><span style="color:gray">,</span><font color="#000000"> </font><span style="color:red">'P'</span><span style="color:gray">)</span><font color="#000000"> </font><span style="color:gray">IS</span><font color="#000000"> </font><span style="color:gray">NOT</span><font color="#000000"> </font><span style="color:gray">NULL</span><font color="#000000"> </font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">DROP</span><font color="#000000"> </font><span style="color:blue">PROCEDURE</span><font color="#000000"> [dbo]</font><span style="color:gray">.</span><font color="#000000">[GenMetadata]</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000">GO</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;color:blue;font-family:Consolas">CREATE</span><span style="font-size:8pt;font-family:Consolas"><font color="#000000"> </font><span style="color:blue">PROCEDURE</span><font color="#000000"> [dbo]</font><span style="color:gray">.</span><font color="#000000">[GenMetadata]</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;color:blue;font-family:Consolas">AS</span><span style="font-size:8pt;font-family:Consolas"><font color="#000000"> </font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">SET</span><font color="#000000"> </font><span style="color:blue">NOCOUNT</span><font color="#000000"> </font><span style="color:blue">ON</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style=""> </span></font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">IF</span><font color="#000000"> 1 </font><span style="color:gray">=</span><font color="#000000"> 0 </font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">        </font></span><span style="color:blue">BEGIN</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">            </font></span><span style="color:green">-- Publish metadata</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">            </font></span><span style="color:blue">SELECT</span><span style=""><font color="#000000">  </font></span><span style="color:fuchsia">CAST</span><span style="color:gray">(NULL</span><font color="#000000"> </font><span style="color:blue">AS</span><font color="#000000"> </font><span style="color:blue">INT</span><span style="color:gray">)</span><font color="#000000"> </font><span style="color:blue">AS</span><font color="#000000"> id</font><span style="color:gray">,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">                    </font></span><span style="color:fuchsia">CAST</span><span style="color:gray">(NULL</span><font color="#000000"> </font><span style="color:blue">AS</span><font color="#000000"> </font><span style="color:blue">NCHAR</span><span style="color:gray">(</span><font color="#000000">10</font><span style="color:gray">))</span><font color="#000000"> </font><span style="color:blue">AS</span><font color="#000000"> [Name]</font><span style="color:gray">,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">                    </font></span><span style="color:fuchsia">CAST</span><span style="color:gray">(NULL</span><font color="#000000"> </font><span style="color:blue">AS</span><font color="#000000"> </font><span style="color:blue">NCHAR</span><span style="color:gray">(</span><font color="#000000">10</font><span style="color:gray">))</span><font color="#000000"> </font><span style="color:blue">AS</span><font color="#000000"> SirName</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">        </font></span><span style="color:blue">END</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style=""> </span></font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:green">-- Do real work starting here</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">CREATE</span><font color="#000000"> </font><span style="color:blue">TABLE</span><font color="#000000"> #test</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">        </font></span><span style="color:gray">(</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style="">          </span>[id] [int] </font><span style="color:gray">NULL,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style="">          </span>[Name] [nchar]</font><span style="color:gray">(</span><font color="#000000">10</font><span style="color:gray">)</span><font color="#000000"> </font><span style="color:gray">NULL,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style="">          </span>[SirName] [nchar]</font><span style="color:gray">(</span><font color="#000000">10</font><span style="color:gray">)</span><font color="#000000"> </font><span style="color:gray">NULL</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">        </font></span><span style="color:gray">)</span><font color="#000000"> </font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style=""> </span></font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style=""> </span></font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">INSERT</span><span style=""><font color="#000000">  </font></span><span style="color:blue">INTO</span><font color="#000000"> #test</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">            </font></span><span style="color:blue">SELECT</span><span style=""><font color="#000000">  </font></span><span style="color:red">'1'</span><span style="color:gray">,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">                    </font></span><span style="color:red">'A'</span><span style="color:gray">,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">                    </font></span><span style="color:red">'Z'</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">            </font></span><span style="color:blue">UNION ALL</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">            </font></span><span style="color:blue">SELECT</span><span style=""><font color="#000000">  </font></span><span style="color:red">'2'</span><span style="color:gray">,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">                    </font></span><span style="color:red">'b'</span><span style="color:gray">,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">                    </font></span><span style="color:red">'y'</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style=""> </span></font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">SELECT</span><font color="#000000"><span style="">  </span>id</font><span style="color:gray">,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style="">            </span>[Name]</font><span style="color:gray">,</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><font color="#000000"><span style="">            </span>SirName</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">FROM</span><font color="#000000"><span style="">    </span>#test</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">DROP</span><font color="#000000"> </font><span style="color:blue">TABLE</span><font color="#000000"> #test</font></span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:8pt;font-family:Consolas"><span style=""><font color="#000000">    </font></span><span style="color:blue">RETURN</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:8pt;line-height:115%;font-family:Consolas"><font color="#000000">GO</font></span> </p></font></font><font size=2></font></span></div></div> <p> </p></font> <p></p><font size=2> <p></p></font></span> <p><span></span> </p> <p><span></span> </p> <p><span></span> </p>Fri, 29 Jun 2007 14:59:50 Z2007-06-29T14:59:50Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#f3061fdf-be83-4dba-b57a-c62ba681cd75http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#f3061fdf-be83-4dba-b57a-c62ba681cd75Mallikarjun n Channappagoudrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Mallikarjun%20n%20Channappagoudrahow to call a stored procedure in SSISHi Thank you very much..<br><br>It is now working fine for the changes you suggested..<br>Thu, 12 Jul 2007 13:48:40 Z2007-07-12T13:48:40Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#ddbf8bce-eb79-42cb-bdfc-4cbf45d69989http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#ddbf8bce-eb79-42cb-bdfc-4cbf45d69989Mallikarjun n Channappagoudrahttp://social.msdn.microsoft.com/Profile/en-US/?user=Mallikarjun%20n%20Channappagoudrahow to call a stored procedure in SSISHello,<br><br>With the procedure you have told,SSIS package able to detect output of the stored procedure.<br>But there another problem introduced bcz of this procedure.Where According to your procedure the SP returns two datasets.<br> First dataset having 1 row and this is as a result of First select statement. <br> Second dataset bcz of our actual select query.<br><br>So SSIS chooses first dataset,So returns only one row having Null values for all columns.<br><br>How to overcome from this?<br>Tue, 14 Aug 2007 08:50:27 Z2007-08-14T08:50:27Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#ec54b0ef-db13-4573-b8fb-a23cb2af88bfhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#ec54b0ef-db13-4573-b8fb-a23cb2af88bfjaegdhttp://social.msdn.microsoft.com/Profile/en-US/?user=jaegdhow to call a stored procedure in SSIS<p align=left><font face=Arial size=2>Post a sproc, or usage of the above sproc, which demonstrates the problem (e.g. OPENQUERY, EXEC, INSERT EXEC, so on...)</font></p>Wed, 15 Aug 2007 03:32:12 Z2007-08-15T03:32:12Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#8e7a4287-a1fc-4a21-96a3-f08b3cfa8169http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#8e7a4287-a1fc-4a21-96a3-f08b3cfa8169ajedi2khttp://social.msdn.microsoft.com/Profile/en-US/?user=ajedi2khow to call a stored procedure in SSISwhat if you want to execute a dynamic script i.e.<br><br> <div style="margin-left:40px;text-align:left"> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Block</span></div> <p>create procedure etl.executeScript @scriptId int, @sessionId varchar(50)<br>as <br>    set nocount on<br>    declare @script nvarchar(max)<br><br>    select @script=replace(script,'SESSION-ID',@sessionId)<br>    from etl.script <br>    where id=@scriptId<br>    <br>    exec sp_executesql  @script<br>return</p></div></div><br></div><br>exec etl.executeScript 1, 'my session'<br><br>basically every script has an id, and a sessionid. ole db command can't pick the meta data coming out of this stored procedure.<br><br>in the etl.script table, usually scripts meta data don't change, mostly it's the where class that changes.<br><br>when executing the ssis package, script id remains the same, the only thing that change is the sessionid. so for the engine meta data never changes, only the body does. for example a tipical script would look like<br><br>select fundid, fundname, descrptin<br>from dbo.currentsession<br>where sessionid='SESSION-ID'<br><br>so the etl.executeScript stroed procedure replace the sessionid with the passesed sessionid.<br><br>any help as to how i can get ole db source to show up the meta data in the columns section.<br><br>cheers<br><br><br>Fri, 16 Nov 2007 04:09:27 Z2007-11-16T04:09:27Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#e7c2842a-1a0d-4bde-b0aa-aa5d6efeecc7http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#e7c2842a-1a0d-4bde-b0aa-aa5d6efeecc7jwelchhttp://social.msdn.microsoft.com/Profile/en-US/?user=jwelchhow to call a stored procedure in SSISI realize this probably isn't the answer you are looking for, but why not just put in the actual SQL, with a parameter for SessionID? What's the point of using a dynamic script if the metadata will always be the same? <p align=left><font face=Arial size=2></font> </p>Sun, 18 Nov 2007 22:30:15 Z2007-11-18T22:30:15Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#49e3b7c9-e548-4fac-896d-ea6ada3af790http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#49e3b7c9-e548-4fac-896d-ea6ada3af790ajedi2khttp://social.msdn.microsoft.com/Profile/en-US/?user=ajedi2khow to call a stored procedure in SSIShi jewlch.<br>basically i'm trying to avoide opening up SSIS for every scrpt change. i only want to open SSIS if there's a meta data change to fix it up. also as you probably know there's a sql command text limit of 4000 characters. sometimes my queries get a little big, (trust me they are optimised to the best extent, but some of them have derived queries with in, so no point in breaking up really)<br><br><br>Wed, 21 Nov 2007 03:00:18 Z2007-11-21T03:00:18Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#0572594e-d039-49de-a25e-ee7f4510d8b3http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#0572594e-d039-49de-a25e-ee7f4510d8b3Mahesh Shindehttp://social.msdn.microsoft.com/Profile/en-US/?user=Mahesh%20Shindehow to call a stored procedure in SSISHey I am facing another problem that I have multiple #tables and multiple select statement in Store proce and SSIS says # table does not exist. As suggested by him if I put Return any where in between it will come out without executing multiple record set. Please advice <p align=left><font face=Arial size=2></font> </p>Wed, 11 Jun 2008 22:37:35 Z2008-06-11T22:37:35Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#d259eb61-14bd-42e5-a1c4-74f6db757ecfhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#d259eb61-14bd-42e5-a1c4-74f6db757ecfjwelchhttp://social.msdn.microsoft.com/Profile/en-US/?user=jwelchhow to call a stored procedure in SSISTry putting a non-executing SELECT statement at the beginning of the procedure, as jaegd showed earlier in this thread. <p align=left><font face=Arial size=2></font> </p>Fri, 13 Jun 2008 21:07:41 Z2008-06-13T21:07:41Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#03e2c116-5d84-4dc2-8e06-2ec531513946http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#03e2c116-5d84-4dc2-8e06-2ec531513946c-j-phttp://social.msdn.microsoft.com/Profile/en-US/?user=c-j-phow to call a stored procedure in SSIS<p align=left><font face=Arial size=2>I've been having similar issues which jaegd's example looked like it would solve. It worked when I tested with a SQL server simple example of a proc using a temp table but failed for a Sybase data source with a more complex proc.</font></p> <p align=left> </p> <p align=left>I cannot get this workaround to work with Sybase as the OLEDB source, even with a very simple proc example?</p> <p align=left> </p> <p align=left>Are there additional complications with using Sybase? </p> <p align=left> </p> <p align=left>Many thanks,</p> <p align=left>Chris</p>Thu, 19 Jun 2008 17:44:16 Z2008-06-19T17:44:16Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#da71404b-307d-4dec-8fd7-5800656b8872http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#da71404b-307d-4dec-8fd7-5800656b8872fredd00http://social.msdn.microsoft.com/Profile/en-US/?user=fredd00how to call a stored procedure in SSISHi I still can't see the outpout columns in OleDb Command Output Columns<br> , how can i get the output columns. I want to use them to insert in ole db destination<br> <br> here is my sp:<br> create PROCEDURE [dbo].[GetData] (<br>     @user        varchar(50)<br> ) AS<br> set nocount on<br> -- Publish metadata for ssis<br> if 1=0<br> begin<br>     select '' x, '' y, '' z<br> end<br> <br> declare @user_tmp table<br> (<br>     x varchar(max),<br>     y varchar(max),<br>     z varchar(max)<br> )<br> <br> insert into @user_tmp<br>     select 'x1' x, 'y1' y, 'z1' z<br> <br> select distinct *  from @user_tmp<br> set nocount off Thu, 19 Mar 2009 15:38:58 Z2009-03-19T15:38:58Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#8e2fd913-2472-4c75-8f9d-02de63f01cc3http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#8e2fd913-2472-4c75-8f9d-02de63f01cc3mlophttp://social.msdn.microsoft.com/Profile/en-US/?user=mlophow to call a stored procedure in SSISi had the same problem--<br/>there is two things u need to do . u need to alter your stored procedure and add is just after the  begin statment.<span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"><br/>SET</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">NOCOUNT</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">ON<span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff"> <p>SET</p> <hr class=sig> kkkk</span></span></span></span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">FMTONLY</span></span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff"><span style="font-size:x-small;color:#0000ff">OFF<br/><br/><br/><br/><br/></span></span>Fri, 03 Apr 2009 16:31:45 Z2009-04-03T16:32:12Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#eae766ab-e0fb-4327-965a-20d42ed80db5http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ee686cf8-0880-4a1d-8706-ba72fbb2eba8#eae766ab-e0fb-4327-965a-20d42ed80db5mlophttp://social.msdn.microsoft.com/Profile/en-US/?user=mlophow to call a stored procedure in SSIS<p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small;font-family:Calibri">Here is what u need to do alter your stored procdures and just after the</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small;font-family:Calibri">Begin statement do this</span></p> <p class=MsoNormal style="margin:0in 0in 0pt;line-height:normal"><span style="font-size:10pt;color:blue;font-family:'Courier New'">SET</span><span style="font-size:10pt;font-family:'Courier New'"> <span style="color:blue">NOCOUNT</span> <span style="color:blue">ON</span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:10pt;color:blue;line-height:115%;font-family:'Courier New'">SET</span><span style="font-size:10pt;line-height:115%;font-family:'Courier New'"> <span style="color:blue">FMTONLY</span> <span style="color:blue">OFF</span></span></p><hr class="sig">kkkkFri, 03 Apr 2009 16:34:05 Z2009-04-03T16:34:05Z