<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SQL Pass through multiple connections in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-through-multiple-connections/m-p/560087#M10423</link>
    <description>&lt;P&gt;You can do that, you must add the database name to the table qualifiers:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/11426929/can-we-use-join-for-two-different-database-tables" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/11426929/can-we-use-join-for-two-different-database-tables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note this is the first result of a google search for "ms sql server join tables from different databases". See Maxim 6, Google Is Your Friend.&lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2019 11:16:45 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-05-20T11:16:45Z</dc:date>
    <item>
      <title>SQL Pass through multiple connections</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-through-multiple-connections/m-p/560036#M10415</link>
      <description>&lt;P&gt;Hello I am running a query in SQL. I have to use multiple pass through in the Proc SQL and the code inside the SQL passthrough is the code of SQL. The issue is there are two tables from two different database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know how can I do it here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LIBNAME web_srv SQLSVR Datasrc=webservices SCHEMA=dbo USER=sasproduction&lt;BR /&gt;PASSWORD="***&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LIBNAME sqlsas SQLSVR Datasrc=WebServices SCHEMA=dbo USER=sasproduction&lt;BR /&gt;PASSWORD=**** ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the query in SQL&lt;/P&gt;&lt;P&gt;Select&lt;BR /&gt;MOT.Policyno as PolicyNo,&lt;BR /&gt;POLS.PolicyStatus as PolicyStatus&lt;BR /&gt;,case when MOT.PolicyEndDate &amp;gt; GETDATE() then 'Y' Else 'N' end&lt;BR /&gt;POLICY_ACTIVE_INACTIVE_FLG&lt;BR /&gt;,MOT.SMCode as SMCode&lt;BR /&gt;--,PR.Channel M200_Channel&lt;BR /&gt;--,PR.SM_Name M200_SalesManagerName&lt;BR /&gt;,MOT.ProductCode ProductCode&lt;BR /&gt;,MOT.PolicyStartDate as PolicyStartDate&lt;BR /&gt;,MOT.PolicyEndDate as PolicyEndDate&lt;BR /&gt;,MOT.AgentCode AgentCode&lt;BR /&gt;,MOT.BasCode BasCode&lt;BR /&gt;,isnull(PR.Branch_Code,substring(mot.policyno,1,4)) Branch_Code&lt;BR /&gt;,MOT.SumInsured SumInsured&lt;BR /&gt;--,PR.NET_PREMIUM M400_NetPremium&lt;BR /&gt;,MOT.netOD+MOT.netTP as TotalPremium&lt;BR /&gt;,DATEDIFF(YY,MOT.PolicyStartDate,MOT.PolicyEndDate) policyTenure&lt;BR /&gt;,PR.PAYMENT_MODE as PaymentMode&lt;BR /&gt;,POLS.PolicyStatus as CANCELLED_FLAG&lt;BR /&gt;,null as EndorsementCnt&lt;BR /&gt;from&lt;BR /&gt;webservices..tbl_motor MOT with(nolock)&lt;BR /&gt;inner join sqlsas..CMDM_Product_Master PM WITH (nolock) on MOT.ProductCode =PM.Product_code&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Now I want to run the above SQL query in pass through but pass through has single statement. I want it from two different databases in SQL..please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 08:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-through-multiple-connections/m-p/560036#M10415</guid>
      <dc:creator>sameer112217</dc:creator>
      <dc:date>2019-05-20T08:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Pass through multiple connections</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-through-multiple-connections/m-p/560087#M10423</link>
      <description>&lt;P&gt;You can do that, you must add the database name to the table qualifiers:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/11426929/can-we-use-join-for-two-different-database-tables" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/11426929/can-we-use-join-for-two-different-database-tables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note this is the first result of a google search for "ms sql server join tables from different databases". See Maxim 6, Google Is Your Friend.&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 11:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-through-multiple-connections/m-p/560087#M10423</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-20T11:16:45Z</dc:date>
    </item>
  </channel>
</rss>

