[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: SQL access
From:       Stanford Mwasongwe <smwasongwe () GMAIL ! COM>
Date:       2023-01-26 17:43:55
Message-ID: CAAfzsF79rns1HbxqQwgueCGW+2D211c08tMGr7NFjG-Pra5okA () mail ! gmail ! com
[Download RAW message or body]

I just realized the way our system is set-up, a simple libname is able to
connect to SQL server
libname rdb odbc datasrc = schema
For some reasons I thought the name of the server has to be specified,
thank you everyone for the help.
Best
*Stanford*



On Thu, Jan 26, 2023 at 8:18 AM Alan Churchill <savian.net@gmail.com> wrote:

> The driver name looks wrong. It tends to be very specific. When doing
> these NOPROMPT connection strings, best to start here:
>
> https://www.connectionstrings.com/sql-server/
>
> Here is an example showing how specific it can be:
>
> libname AUDIT ODBC NOPROMPT="server=SVDSQLASASAUDITD;driver=ODBC Driver 17
> for SQL Server;uid=***;pwd=***;database=DB;" STRINGDATES=NO
> IGNORE_READ_ONLY_COLUMNS=YES SCHEMA=DBO;
>
> Alan Churchill
> Savian, LLC
>
> -----Original Message-----
> From: SAS(r) Discussion <SAS-L@LISTSERV.UGA.EDU> On Behalf Of Tim
> Berryhill
> Sent: Thursday, January 26, 2023 7:45 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: SQL access
>
> Stanford, What OS are you running?  I have opened unsuccessful tracks with
> both SAS Institute and OpenLink over a very similar failure, using the
> NOPROMPT syntax to avoid an entry in odbc.ini.
>
> If you have access to odbc.ini, using ODBC Dataset Names (DSN's) is much
> easier and better documented.
>
> Where you have DRIVER=SQL Server, after that failed the way yours is
> failing, I put the linux (I am running there) path and filename of the
> driver.  That got me an error that the server is not recognized.  That is
> the error I opened both tracks for.
>
> It is unfortunate that my support says they can only enable logging for a
> DSN.  Because I am deliberately not using a DSN, they cannot or will not
> produce the log OpenLink requested.
>
> Happy Hunting
> -----Original Message-----
> From: SAS(r) Discussion <SAS-L@LISTSERV.UGA.EDU> On Behalf Of SAS-L
> automatic digest system
> Sent: Wednesday, January 25, 2023 10:00 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: SAS-L Digest - 24 Jan 2023 to 26 Jan 2023 (#2023-32)
>
> There are 2 messages totaling 156 lines in this issue.
>
> Topics of the day:
>
>   1. SQL access
>   2. SSN validity check
>
> ----------------------------------------------------------------------
>
> Date:    Wed, 25 Jan 2023 10:10:39 -0700
> From:    Stanford Mwasongwe <smwasongwe@GMAIL.COM>
> Subject: SQL access
>
> Hi all,
> I have the following info in R and I need to create the same thing in SAS
> to access the data.
> MEDSS<- DBI::dbConnect(drv = odbc::odbc(),
>                         Driver = "SQL Server",
>                         Server = "nanananan",
>                         Database = "rdb",
>                         Trusted_connection= "True") I developed the
> following libname sysncr ODBC NOPROMPT = "DRIVER=SQL Server; SERVER =
> nananananna; DATABASE = RDB; TRUSTED_CONNECTION = YES"
> schema = dbo;
> quit;
> Here is the error in the log
> ERROR: CLI error trying to establish connection: [Microsoft][ODBC SQL
> Server Driver]Neither DSN nor
>        SERVER keyword supplied : [Microsoft][ODBC SQL Server
> Driver]Invalid connection string
>        attribute
> ERROR: Error in the LIBNAME statement.
> Thanks for the help
> *Stanford*
>

[Attachment #3 (text/html)]

<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">I \
just realized the way our system is set-up, a simple libname is able to connect to \
SQL server</div><div class="gmail_default" \
style="font-family:verdana,sans-serif">libname rdb odbc datasrc = schema</div><div \
class="gmail_default" style="font-family:verdana,sans-serif">For some reasons I \
thought the name of the server has to be specified, thank you everyone for the \
help.</div><div class="gmail_default" \
style="font-family:verdana,sans-serif">Best</div><div><div dir="ltr" \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span \
style="font-size:x-small"><font size="2"><font><span style="font-size:10pt"><font \
face="bookman old style, new york, times, serif" \
color="#444444"><b>Stanford</b></font></span></font></font></span></div><div><br></div></div></div></div><br></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 26, 2023 at 8:18 AM \
Alan Churchill &lt;<a href="mailto:savian.net@gmail.com">savian.net@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The driver name looks \
wrong. It tends to be very specific. When doing these NOPROMPT connection strings, \
best to start here:<br> <br>
<a href="https://www.connectionstrings.com/sql-server/" rel="noreferrer" \
target="_blank">https://www.connectionstrings.com/sql-server/</a><br> <br>
Here is an example showing how specific it can be:<br>
<br>
libname AUDIT ODBC NOPROMPT=&quot;server=SVDSQLASASAUDITD;driver=ODBC Driver 17 for \
SQL Server;uid=***;pwd=***;database=DB;&quot; STRINGDATES=NO \
IGNORE_READ_ONLY_COLUMNS=YES SCHEMA=DBO;<br> <br>
Alan Churchill<br>
Savian, LLC<br>
<br>
-----Original Message-----<br>
From: SAS(r) Discussion &lt;<a href="mailto:SAS-L@LISTSERV.UGA.EDU" \
                target="_blank">SAS-L@LISTSERV.UGA.EDU</a>&gt; On Behalf Of Tim \
                Berryhill<br>
Sent: Thursday, January 26, 2023 7:45 AM<br>
To: <a href="mailto:SAS-L@LISTSERV.UGA.EDU" \
                target="_blank">SAS-L@LISTSERV.UGA.EDU</a><br>
Subject: SQL access<br>
<br>
Stanford, What OS are you running?   I have opened unsuccessful tracks with both SAS \
Institute and OpenLink over a very similar failure, using the NOPROMPT syntax to \
avoid an entry in odbc.ini.<br> <br>
If you have access to odbc.ini, using ODBC Dataset Names (DSN&#39;s) is much easier \
and better documented.<br> <br>
Where you have DRIVER=SQL Server, after that failed the way yours is failing, I put \
the linux (I am running there) path and filename of the driver.   That got me an \
error that the server is not recognized.   That is the error I opened both tracks \
for.<br> <br>
It is unfortunate that my support says they can only enable logging for a DSN.   \
Because I am deliberately not using a DSN, they cannot or will not produce the log \
OpenLink requested.<br> <br>
Happy Hunting<br>
-----Original Message-----<br>
From: SAS(r) Discussion &lt;<a href="mailto:SAS-L@LISTSERV.UGA.EDU" \
target="_blank">SAS-L@LISTSERV.UGA.EDU</a>&gt; On Behalf Of SAS-L automatic digest \
                system<br>
Sent: Wednesday, January 25, 2023 10:00 PM<br>
To: <a href="mailto:SAS-L@LISTSERV.UGA.EDU" \
                target="_blank">SAS-L@LISTSERV.UGA.EDU</a><br>
Subject: SAS-L Digest - 24 Jan 2023 to 26 Jan 2023 (#2023-32)<br>
<br>
There are 2 messages totaling 156 lines in this issue.<br>
<br>
Topics of the day:<br>
<br>
   1. SQL access<br>
   2. SSN validity check<br>
<br>
----------------------------------------------------------------------<br>
<br>
Date:      Wed, 25 Jan 2023 10:10:39 -0700<br>
From:      Stanford Mwasongwe &lt;<a href="mailto:smwasongwe@GMAIL.COM" \
                target="_blank">smwasongwe@GMAIL.COM</a>&gt;<br>
Subject: SQL access<br>
<br>
Hi all,<br>
I have the following info in R and I need to create the same thing in SAS to access \
the data.<br> MEDSS&lt;- DBI::dbConnect(drv = odbc::odbc(),<br>
                                    Driver = &quot;SQL Server&quot;,<br>
                                    Server = &quot;nanananan&quot;,<br>
                                    Database = &quot;rdb&quot;,<br>
                                    Trusted_connection= &quot;True&quot;) I developed \
the following libname sysncr ODBC NOPROMPT = &quot;DRIVER=SQL Server; SERVER = \
nananananna; DATABASE = RDB; TRUSTED_CONNECTION = YES&quot;<br> schema = dbo;<br>
quit;<br>
Here is the error in the log<br>
ERROR: CLI error trying to establish connection: [Microsoft][ODBC SQL Server \
                Driver]Neither DSN nor<br>
           SERVER keyword supplied : [Microsoft][ODBC SQL Server Driver]Invalid \
connection string<br>  attribute<br>
ERROR: Error in the LIBNAME statement.<br>
Thanks for the help<br>
*Stanford*<br>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic