<?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: SQLSERVER to SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718709#M222456</link>
    <description>&lt;P&gt;Sure, try adding this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  connect using SQLSRVR;
execute (declare @counter int
set @counter=1
      while @counter&amp;gt;0
          begin
              begin
                  select * into #a from abc;
              end;
               begin
                   update x set y=m from #a x inner join b y on x.id=i.id;
               end;
              begin
                  drop table #a
              end;
             select @counter=@@rowcount
        end) by SQLSRVR;
  create table MySASTable as 
  select * from connection to SQLSRVR
(select * from tempdb.x); 
quit; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Feb 2021 19:16:33 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2021-02-11T19:16:33Z</dc:date>
    <item>
      <title>SQLSERVER to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718356#M222312</link>
      <description>&lt;P&gt;Hi Every one,&lt;/P&gt;&lt;P&gt;Could you help in converting the code .&lt;/P&gt;&lt;P&gt;we got requirement that need to convert the sqlserver code to the SAS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are 100 records in table abc and b.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;declare @counter int
set @counter=1
      while @counter&amp;gt;0
          begin
              begin
                  select * into #a from abc;
              end;
               begin
                   update x set y=m &lt;SPAN&gt;from #a x inner join b y &lt;/SPAN&gt;&lt;SPAN&gt;on x.id=i.id;&lt;/SPAN&gt;
               end;
              begin
                  drop table #a
              end;
             select @counter=@@rowcount
        end&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 19:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718356#M222312</guid>
      <dc:creator>samanvi</dc:creator>
      <dc:date>2021-02-10T19:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQLSERVER to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718369#M222319</link>
      <description>&lt;P&gt;Not every sas programer knows sqlserver .&lt;/P&gt;
&lt;P&gt;It could help if you describe the function that code runs:&lt;/P&gt;
&lt;P&gt;it seems there are two inputs A and B and code executes an inner join.&lt;/P&gt;
&lt;P&gt;I can't guess more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 19:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718369#M222319</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-10T19:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: SQLSERVER to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718386#M222330</link>
      <description>&lt;P&gt;If you are not moving your data out of SQL Server then the best option is simply to wrap the SQL Server SQL unchanged into a SAS SQL passthru query.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SQLSRVR odbc noprompt = "&amp;lt;SQL Server connection string&amp;gt;" DATABASE = MySQLServerDatabase;

proc sql noprint;
  connect using SQLSRVR;
execute (declare @counter int
set @counter=1
      while @counter&amp;gt;0
          begin
              begin
                  select * into #a from abc;
              end;
               begin
                   update x set y=m from #a x inner join b y on x.id=i.id;
               end;
              begin
                  drop table #a
              end;
             select @counter=@@rowcount
        end) by SQLSRVR;
quit;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Feb 2021 20:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718386#M222330</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-02-10T20:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: SQLSERVER to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718670#M222447</link>
      <description>&lt;P&gt;Thank you it worked for me. Is there a way to pull output table x? as x is an temporary table. I have read permission in sqlserver only. Is there a way to pull output data(table x) make to the sas dataset&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 17:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718670#M222447</guid>
      <dc:creator>samanvi</dc:creator>
      <dc:date>2021-02-11T17:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: SQLSERVER to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718709#M222456</link>
      <description>&lt;P&gt;Sure, try adding this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  connect using SQLSRVR;
execute (declare @counter int
set @counter=1
      while @counter&amp;gt;0
          begin
              begin
                  select * into #a from abc;
              end;
               begin
                   update x set y=m from #a x inner join b y on x.id=i.id;
               end;
              begin
                  drop table #a
              end;
             select @counter=@@rowcount
        end) by SQLSRVR;
  create table MySASTable as 
  select * from connection to SQLSRVR
(select * from tempdb.x); 
quit; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Feb 2021 19:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718709#M222456</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-02-11T19:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: SQLSERVER to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718851#M222509</link>
      <description>Thank you.</description>
      <pubDate>Fri, 12 Feb 2021 11:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQLSERVER-to-SAS/m-p/718851#M222509</guid>
      <dc:creator>samanvi</dc:creator>
      <dc:date>2021-02-12T11:18:49Z</dc:date>
    </item>
  </channel>
</rss>

