﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / How do I call query on linked AS/400? / 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>Sat, 18 May 2013 08:59:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How do I call query on linked AS/400?</title><link>http://www.sqlservercentral.com/Forums/Topic636465-338-1.aspx</link><description>Here's my super awesome cheaty way to do this easily.  I wrote an FTP batch filethat FTPs into the AS400 and runs the query with: quote rcmd runqqry qry(lib/qry)The FTP batch file is executed on the SQL 2005 server by use of a storedprocedure containing the line:EXEC master..xp_cmdshell 'ftp -n -s:d:\ftp_scripts\batch.ftp'Then I grab the output like normal through use of the linked servers.  And viola!</description><pubDate>Thu, 15 Jan 2009 08:07:06 GMT</pubDate><dc:creator>andy.gear</dc:creator></item><item><title>How do I call query on linked AS/400?</title><link>http://www.sqlservercentral.com/Forums/Topic636465-338-1.aspx</link><description>So I have the ODBC connection set up and working fine between the SQL server and my AS/400.  I can query just fine:[code]select * from LINKED_SERVER.NAME.LIBRARY.FILE[/code]What I would like to do now is:[code]exec LINKED_SERVER.NAME.LIBRARY.QUERY[/code]</description><pubDate>Wed, 14 Jan 2009 10:48:05 GMT</pubDate><dc:creator>andy.gear</dc:creator></item></channel></rss>