﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Programming / General  / Call DB2 stored procedure using Linked Server? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 19:05:25 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Call DB2 stored procedure using Linked Server?</title><link>http://www.sqlservercentral.com/Forums/Topic801572-23-1.aspx</link><description>Sweet.  Really nice find, Jeff.  This goes in my Favorites list...  :-)</description><pubDate>Mon, 05 Nov 2012 11:53:34 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>RE: Call DB2 stored procedure using Linked Server?</title><link>http://www.sqlservercentral.com/Forums/Topic801572-23-1.aspx</link><description>I know it's an old post but the following should help a lot.[url]http://www.mcpressonline.com/index2.php?option=com_content&amp;do_pdf=1&amp;id=1541[/url]The keys to the magic appear in the following...[code="sql"]---- Create Linked Server using ODBC DSN "AS400"--sp_addlinkedserver     @server=N'DB2400',     @srvproduct=N'DB2 UDB for iSeries',    @provider=N'MSDASQL',    @datasrc=N'AS400',    @provstr='CMT=0;SYSTEM=as400.mycompany.com',    @catalog='S104X824'go---- Define the credentials that will be used to-- access objects hosted by the Linked Server--sp_addlinkedsrvlogin @rmtsrvname=N'DB2400',                     @useself='false',                     @rmtuser=N'MyUser',                     @rmtpassword='MyPassword'go---- RPC option is required for doing EXEC AT--EXEC sp_serveroption 'DB2400', 'rpc out', truego[/code]The biggest key here is that you must use the MSDASQL driver and you must enable "rpc out".The article at the link also gives an example call to return a result set as follows...  Obviously, the temp table must already exist but that's also covered in the article.[code="sql"]---- A DB2 stored procedure can be executed--Set @OrderID = 10249Insert Into #tmpOrderHdrExec ('Call DATALIB.GetOrders (?)', @OrderID) AT DB2400[/code][font="Arial Black"]To be clear, I've not tried any of this, yet.  Our infrastructure team is in the process of installing the correct MSDASQL driver.[/font]</description><pubDate>Fri, 02 Nov 2012 15:12:59 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Call DB2 stored procedure using Linked Server?</title><link>http://www.sqlservercentral.com/Forums/Topic801572-23-1.aspx</link><description>Have you tried using the EXEC..AT feature?</description><pubDate>Mon, 12 Oct 2009 20:05:19 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>Call DB2 stored procedure using Linked Server?</title><link>http://www.sqlservercentral.com/Forums/Topic801572-23-1.aspx</link><description>Hi Everyone,Is it possible to call a DB2 stored procedure using a linked server? I've read a bunch of conflicting information out on the internet. Various posts have claimed it is not supported but then I came across a couple of posts which suggest it is possible. If it is possible..please provide me with a link to the information. Any help is appreciated!Thanks</description><pubDate>Mon, 12 Oct 2009 07:45:15 GMT</pubDate><dc:creator>speja01</dc:creator></item></channel></rss>