<?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: SAS connect with MS SQL Server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878233#M346973</link>
    <description>&lt;P&gt;Worked, Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 30 May 2023 13:38:46 GMT</pubDate>
    <dc:creator>vijaypratap0195</dc:creator>
    <dc:date>2023-05-30T13:38:46Z</dc:date>
    <item>
      <title>SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877851#M346805</link>
      <description>&lt;P&gt;I am trying to connect MSSQL Server with SAS using the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;1. SQL Pass-Through, or explicit pass-through&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2. LIBNAME statement, or implicit pass-through&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I am unable to make a connection between them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are my MSSQl details (I am trying to do this using Windows authentication)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_1-1685183775710.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84380i014DB2A2A2C70F79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_1-1685183775710.png" alt="vijaypratap0195_1-1685183775710.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_2-1685183872964.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84381i89D9DE8AAE1C2055/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_2-1685183872964.png" alt="vijaypratap0195_2-1685183872964.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help with the complete code I can use in my SAS EG to connect SAS with MSSQL?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Vijay&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 10:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877851#M346805</guid>
      <dc:creator>vijaypratap0195</dc:creator>
      <dc:date>2023-05-27T10:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877879#M346818</link>
      <description>&lt;P&gt;First run this code and then show us the result from the log:&lt;/P&gt;
&lt;PRE&gt;Proc setinit; 
run;&lt;/PRE&gt;
&lt;P&gt;Go to the log and copy the results starting at Product Expiration dates and then post into a text box opened on the forum using the &amp;lt;/&amp;gt; icon above the main message window. You should see something like:&lt;/P&gt;
&lt;PRE&gt;Product expiration dates:
---Base SAS Software
      30JAN2025
---SAS/STAT
      30JAN2025
&lt;/PRE&gt;
&lt;P&gt;The output shows what products you have licensed to use. If you don't have SAS Access/SQL Server (or whatever name actually comes up) you may be able to access data through&amp;nbsp; the ODBC connection but that has different limits and abilities than the SQL Server package.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your SAS is running EG on a server then the links would have to be available to server. It would not see any local connection you may have to SQL server and likely need to get your SAS admin involved in getting the mappings set up.&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 21:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877879#M346818</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-27T21:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877881#M346819</link>
      <description>&lt;P&gt;Where is your SAS installed? On a server or on a PC? What SAS/ACCESS product are you using? SQL Server or ODBC? Please post the SAS logs for your two attempts including any errors.&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 23:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877881#M346819</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-05-27T23:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877941#M346855</link>
      <description>&lt;P&gt;I have installed in my PC&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_0-1685291424590.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84396i404E806A8BE5EA22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_0-1685291424590.png" alt="vijaypratap0195_0-1685291424590.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 16:30:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877941#M346855</guid>
      <dc:creator>vijaypratap0195</dc:creator>
      <dc:date>2023-05-28T16:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877967#M346865</link>
      <description>&lt;P&gt;Please post the SAS logs from your two attempts.&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 19:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877967#M346865</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-05-28T19:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877974#M346869</link>
      <description>&lt;P&gt;Since you mention EG and you have SAS/ACCESS to SQL Server, that makes me think that EG (which might be running on Windows) is connecting to a linux SAS server.&amp;nbsp; Is that right?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, then you won't be able to use Windows authentication, because the connection is made from the linux server where the SAS code executes to the database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For connecting from a SAS server, connecting to a new SQL server would typically involve having a SAS server administrator update the odbc.ini file on the server which defines the ODBC connections, and the administrator might also create a SAS library for you.&amp;nbsp; I would suggest working with your server administrator.&amp;nbsp; Or do you have admin privileges on the server?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then you also said you have "installed on your PC."&amp;nbsp; Are you actually running SAS on your local PC (not a server), and using EG to connect to the SAS session on your PC?&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 21:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877974#M346869</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-28T21:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877975#M346870</link>
      <description>&lt;P&gt;That photograph (why take the time to make a picture out of text?) you posted appears to be from SAS running on some server.&amp;nbsp; When I run SETINIT on SAS running on PC it does not mention anything about CPU's.&lt;/P&gt;
&lt;PRE&gt;Product expiration dates:
---Base SAS Software                                                                                    31OCT2023
---SAS/STAT                                                                                             31OCT2023
---SAS/GRAPH                                                                                            31OCT2023
---SAS/ETS                                                                                              31OCT2023
---SAS/FSP                                                                                              31OCT2023
---SAS/OR                                                                                               31OCT2023
---SAS/AF                                                                                               31OCT2023
---SAS/IML                                                                                              31OCT2023
---SAS/QC                                                                                               31OCT2023
---SAS/SHARE                                                                                            31OCT2023
---SAS/ASSIST                                                                                           31OCT2023
---SAS/CONNECT                                                                                          31OCT2023
---SAS/EIS                                                                                              31OCT2023
---SAS/SHARE*NET                                                                                        31OCT2023
---MDDB Server common products                                                                          31OCT2023
---SAS/Secure 168-bit                                                                                   31OCT2023
---SAS/Secure Windows                                                                                   31OCT2023
---SAS Enterprise Guide                                                                                 31OCT2023
---OR OPT                                                                                               31OCT2023
---OR PRS                                                                                               31OCT2023
---OR IVS                                                                                               31OCT2023
---OR LSO                                                                                               31OCT2023
---SAS/ACCESS Interface to Oracle                                                                       31OCT2023
---SAS/ACCESS Interface to PC Files                                                                     31OCT2023
---SAS/ACCESS Interface to ODBC                                                                         31OCT2023
---SAS/IML Studio                                                                                       31OCT2023
---SAS Workspace Server for Local Access                                                                31OCT2023
---High Performance Suite                                                                               31OCT2023
&lt;/PRE&gt;
&lt;P&gt;Compared to running in SAS on UNIX server:&lt;/P&gt;
&lt;PRE&gt;---Base SAS Software                                                                                    30DEC2023 (CPU A)
---SAS/STAT                                                                                             30DEC2023 (CPU A)
---SAS/GRAPH                                                                                            30DEC2023 (CPU A)
---SAS/ETS                                                                                              30DEC2023 (CPU A)
---SAS/FSP                                                                                              30DEC2023 (CPU A)
---SAS/OR                                                                                               30DEC2023 (CPU A)
---SAS/AF                                                                                               30DEC2023 (CPU A)
---SAS/IML                                                                                              30DEC2023 (CPU A)
---SAS/QC                                                                                               30DEC2023 (CPU A)
---SAS/SHARE                                                                                            30DEC2023 (CPU A)
---SAS/CONNECT                                                                                          30DEC2023 (CPU A)
---SAS/SHARE*NET                                                                                        30DEC2023 (CPU A)
---SAS/IntrNet                                                                                          30DEC2023 (CPU A)
---SAS Integration Technologies                                                                         30DEC2023 (CPU A)
---SAS/Secure 168-bit                                                                                   30DEC2023 (CPU A)
---SAS/Genetics                                                                                         30DEC2023 (CPU A)
---SAS Enterprise Guide                                                                                 30DEC2023 (CPU A)
---OR OPT                                                                                               30DEC2023 (CPU A)
---OR PRS                                                                                               30DEC2023 (CPU A)
---OR IVS                                                                                               30DEC2023 (CPU A)
---OR LSO                                                                                               30DEC2023 (CPU A)
---SAS/ACCESS Interface to Oracle                                                                       30DEC2023 (CPU A)
---SAS/ACCESS Interface to PC Files                                                                     30DEC2023 (CPU A)
---SAS/ACCESS Interface to ODBC                                                                         30DEC2023 (CPU A)
---SAS/ACCESS Interface to Microsoft SQL Server                                                         30DEC2023 (CPU A)
---Grid Manager for Platform                                                                            30DEC2023 (CPU A)
---SAS/IML Studio                                                                                       30DEC2023 (CPU A)
---SAS Workspace Server for Local Access                                                                30DEC2023 (CPU A)
---SAS Workspace Server for Enterprise Access                                                           30DEC2023 (CPU A)
---SAS/ACCESS to Amazon Redshift                                                                        30DEC2023 (CPU A)
---High Performance Suite                                                                               30DEC2023 (CPU A)
---SAS Add-in for Microsoft Excel                                                                       30DEC2023 (CPU A)
---SAS Add-in for Microsoft Outlook                                                                     30DEC2023 (CPU A)
---SAS Add-in for Microsoft PowerPoint                                                                  30DEC2023 (CPU A)
---SAS Add-in for Microsoft Word                                                                        30DEC2023 (CPU A)
---SAS/ACCESS to Snowflake                                                                              30DEC2023 (CPU A)
&lt;/PRE&gt;
&lt;P&gt;I am not sure if using Windows Authentication can work from Unix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 22:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/877975#M346870</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-28T22:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878051#M346900</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441716"&gt;@vijaypratap0195&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have installed in my PC&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_0-1685291424590.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84396i404E806A8BE5EA22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_0-1685291424590.png" alt="vijaypratap0195_0-1685291424590.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That actually only shows that the product is licensed.&lt;/P&gt;
&lt;PRE&gt;Proc product_status;
run;&lt;/PRE&gt;
&lt;P&gt;will verify that the modules are actually installed.&lt;/P&gt;
&lt;P&gt;The log looks something like this for each product installed:&lt;/P&gt;
&lt;PRE&gt;For Base SAS Software ...
   Custom version information: 9.4_M4
   Image version information: 9.04.01M4P110916
For SAS/STAT ...
   Custom version information: 14.2
For SAS/GRAPH ...
   Custom version information: 9.4_M4
&lt;/PRE&gt;
&lt;P&gt;You should be able to copy text from your log and then on the forum open a text box using the &amp;lt;/&amp;gt; icon above the message window. Then paste in the text box. For one thing it should be faster than making an image and attaching, second it is easier to read and in the cases of syntax discussion, much easier to copy, correct or make suggestions and paste.&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 15:17:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878051#M346900</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-29T15:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878169#M346952</link>
      <description>&lt;P&gt;I am able to establish the connection between SAS and MSSQL using this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname SQLSRVR odbc noprompt = "Driver=SQL Server;server=VIJAY_PRATAP\SQLEXPRESS;Trusted Connection=yes" DATABASE=test schema=dbo;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_0-1685428901262.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84458i3F6A394919739C1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_0-1685428901262.png" alt="vijaypratap0195_0-1685428901262.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Connection test:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put %sysfunc(ifc(%sysfunc(libref(SQLSRVR)) = 0, "Connection successful", "Connection failed"));&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_1-1685429937691.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84459i3EFBF63FC925B0D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_1-1685429937691.png" alt="vijaypratap0195_1-1685429937691.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;proc datasets lib=SQLSRVR ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_2-1685429985867.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84460i0BB5EC9E65E9AEBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_2-1685429985867.png" alt="vijaypratap0195_2-1685429985867.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I can see only these many datasets/Tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In MSSQL my table is located here in test database:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_3-1685430068196.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84461iFB0A43D15D48DB65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_3-1685430068196.png" alt="vijaypratap0195_3-1685430068196.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please tell me how can I fetch the Table data in SAS here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried :&lt;/P&gt;
&lt;P&gt;proc print data=SQLSRVR.MyTable; run;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_4-1685430136283.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84462i7084CAF4DD7BBD40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_4-1685430136283.png" alt="vijaypratap0195_4-1685430136283.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 07:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878169#M346952</guid>
      <dc:creator>vijaypratap0195</dc:creator>
      <dc:date>2023-05-30T07:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878208#M346962</link>
      <description>&lt;P&gt;Instead of using trusted_connection=yes, maybe try assing user ID and password in the connection string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also what happens if you run:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sqlsrvr.foo;
  x=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Does the SAS log say that it successfully created the table?&amp;nbsp; Can you see the table in SQL Server Management Studio?&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 12:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878208#M346962</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-30T12:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878219#M346967</link>
      <description>&lt;P&gt;It runs without an error:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data sqlsrvr.foo;&lt;BR /&gt;x=1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_0-1685451962649.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84479iBF51076ADA56DCC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_0-1685451962649.png" alt="vijaypratap0195_0-1685451962649.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;table got created in master database instead of test:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_0-1685452332930.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84480iB0052E013E8E4986/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_0-1685452332930.png" alt="vijaypratap0195_0-1685452332930.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname SQLSRVR odbc noprompt = "Driver=SQL Server;server=VIJAY_PRATAP\SQLEXPRESS;Trusted Connection=yes" DATABASE=test schema=dbo;&lt;/P&gt;
&lt;P&gt;%put %sysfunc(ifc(%sysfunc(libref(SQLSRVR)) = 0, "Connection successful", "Connection failed"));&lt;/P&gt;
&lt;P&gt;proc datasets lib=SQLSRVR ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;data sqlsrvr.foo;&lt;BR /&gt;x=1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 13:12:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878219#M346967</guid>
      <dc:creator>vijaypratap0195</dc:creator>
      <dc:date>2023-05-30T13:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878222#M346969</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441716"&gt;@vijaypratap0195&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try using SQL Passthrough&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc SQL;
connect using sqlsrvr&amp;nbsp;as&amp;nbsp;sqlsrvr;&lt;BR /&gt;create table &amp;lt;mytable&amp;gt; as&lt;BR /&gt;select&amp;nbsp;* from&amp;nbsp;connection&amp;nbsp;to sqlsrvr (Select * from dbo.Mytable);&lt;BR /&gt;disconnect from sqlsrvr;&lt;BR /&gt;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is paper for more details and illustration&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.lexjansen.com/sesug/2019/SESUG2019_Paper-157_Final_PDF.pdf" target="_blank"&gt;Emulating FIRST. and LAST. SAS® DATA Step Processing in SQL? Concepts and Review (lexjansen.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 13:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878222#M346969</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-05-30T13:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878224#M346970</link>
      <description>&lt;P&gt;code:&lt;/P&gt;
&lt;P&gt;libname SQLSRVR odbc noprompt = "Driver=SQL Server;server=VIJAY_PRATAP\SQLEXPRESS;Trusted Connection=yes" DATABASE=test schema=dbo;&lt;/P&gt;
&lt;P&gt;Proc SQL;&lt;BR /&gt;connect using sqlsrvr as sqlsrvr;&lt;BR /&gt;create table a as&lt;BR /&gt;select * from connection to sqlsrvr &lt;BR /&gt;(Select * from dbo.Mytable);&lt;BR /&gt;disconnect from sqlsrvr;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vijaypratap0195_0-1685453270266.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84481iCCD232BFC718E70C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vijaypratap0195_0-1685453270266.png" alt="vijaypratap0195_0-1685453270266.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 13:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878224#M346970</guid>
      <dc:creator>vijaypratap0195</dc:creator>
      <dc:date>2023-05-30T13:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878230#M346972</link>
      <description>&lt;P&gt;Great, so that shows that you're connected to the right server, but wrong database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you able to pass the database name inside the connection string, something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SQLSRVR odbc noprompt = "Driver=SQL Server;server=VIJAY_PRATAP\SQLEXPRESS;Trusted Connection=yes;DATABASE=test" ;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&amp;nbsp; You might need to look up the connection string syntax for SQLEXPRESS.&amp;nbsp; &amp;nbsp;There are examples at&amp;nbsp;&lt;A href="https://www.connectionstrings.com/sql-server/" target="_blank"&gt;https://www.connectionstrings.com/sql-server/&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 13:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878230#M346972</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-30T13:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS connect with MS SQL Server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878233#M346973</link>
      <description>&lt;P&gt;Worked, Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 13:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-connect-with-MS-SQL-Server/m-p/878233#M346973</guid>
      <dc:creator>vijaypratap0195</dc:creator>
      <dc:date>2023-05-30T13:38:46Z</dc:date>
    </item>
  </channel>
</rss>

