<?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 LOAD All SQL Server Database Tables to LASR in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/LOAD-All-SQL-Server-Database-Tables-to-LASR/m-p/876014#M17213</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have an SQL Server Database that we would like to load to LASR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some simple questions :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Can we use the ODBC to do so ?&lt;/LI&gt;&lt;LI&gt;If we use the OLEDB, I understand that I need to manually create the query code necessary to load tables to LASR (one table at the time) am I right ?&lt;/LI&gt;&lt;LI&gt;In both cases, are we going to find the same Star Schema in the Database or I should Create a new LASR Star Schema using the tables ?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PS : The SAS/ACCESS Interface to SQL Server is not available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2023 14:00:11 GMT</pubDate>
    <dc:creator>Achraf_Ougdal</dc:creator>
    <dc:date>2023-05-16T14:00:11Z</dc:date>
    <item>
      <title>LOAD All SQL Server Database Tables to LASR</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/LOAD-All-SQL-Server-Database-Tables-to-LASR/m-p/876014#M17213</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have an SQL Server Database that we would like to load to LASR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some simple questions :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Can we use the ODBC to do so ?&lt;/LI&gt;&lt;LI&gt;If we use the OLEDB, I understand that I need to manually create the query code necessary to load tables to LASR (one table at the time) am I right ?&lt;/LI&gt;&lt;LI&gt;In both cases, are we going to find the same Star Schema in the Database or I should Create a new LASR Star Schema using the tables ?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PS : The SAS/ACCESS Interface to SQL Server is not available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 14:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/LOAD-All-SQL-Server-Database-Tables-to-LASR/m-p/876014#M17213</guid>
      <dc:creator>Achraf_Ougdal</dc:creator>
      <dc:date>2023-05-16T14:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD All SQL Server Database Tables to LASR</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/LOAD-All-SQL-Server-Database-Tables-to-LASR/m-p/876087#M17214</link>
      <description>&lt;P&gt;There's no problem with continuing to use OLEDB. If you simply want to copy an SQL Server table into LASR you can automate it like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname MySQLSvr OLEDB &amp;lt;SQLServer connection details&amp;gt;;

%macro Copy_and_Load_LASR ( SQLSrvr_Table = );

* Copy SQL Server table;
proc datasets library = WORK nolist;
  delete &amp;amp;SQLSrvr_Table;
run;
  copy in = MySQLSvr = out = WORK;
  select &amp;amp;SQLSrvr_Table;
run;
quit;

* If table already loaded then delete first.;
proc datasets library = LASRLIB nolist;
  delete &amp;amp;SQLSrvr_Table;
run;
quit;

* Now reload latest table.;
data LASRLIB.&amp;amp;SQLSrvr_Table ( &amp;amp;Table_Options. );
  set WORK.&amp;amp;SQLSrvr_Table;
run;

* Register or update LASR table in metadata. ;
 proc metalib;
   omr (library = "LASRLIB");
   folder       = "/Shared Data/SAS Visual Analytics/Public/LASR";
   select       = ("&amp;amp;SQLSrvr_Table");
   update_rule = (delete);
 run;

%mend Copy_and_Load_LASR;

%Copy_and_Load_LASR (SQLSrvr_Table = MySQLSrvrTable1);
%Copy_and_Load_LASR (SQLSrvr_Table = MySQLSrvrTable2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need to select certain columns then you can easily enhance this macro to select them - no SQL required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 02:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/LOAD-All-SQL-Server-Database-Tables-to-LASR/m-p/876087#M17214</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-05-17T02:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD All SQL Server Database Tables to LASR</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/LOAD-All-SQL-Server-Database-Tables-to-LASR/m-p/877496#M17251</link>
      <description>&lt;P&gt;It worked, Thank you so much !&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 12:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/LOAD-All-SQL-Server-Database-Tables-to-LASR/m-p/877496#M17251</guid>
      <dc:creator>Achraf_Ougdal</dc:creator>
      <dc:date>2023-05-25T12:04:56Z</dc:date>
    </item>
  </channel>
</rss>

