DATA Step, Macro, Functions and more

SAS/ACCESS connects to SQL server db, but I can't see tables.

Reply
New Contributor
Posts: 2

SAS/ACCESS connects to SQL server db, but I can't see tables.

Hello. I successfully set up an ODBC connection on my PC and tested it by connecting to tables using MS Access. The following libname statement references that same odbc connection and completes successfully.

libname srcdata odbc datasrc='DM_training_layer' user='UserID' pw='XXXXX' schema="UserID"
PRESERVE_TAB_NAMES = no PRESERVE_TAB_NAMES = no readbuff=1000 access=readonly;'

However, when I do a proc datasets or try to reference the tables that I know exist, I get the following:

proc datasets library=srcdata;

Directory

Libref SRCDATA
Engine ODBC
Access READONLY
Physical Name DM_training_layer
Schema/Owner Profserv

"WARNING: No matching members in directory."

Has anybody connected to SQL Server with SAS but then not been able to see the tables? Thanks for your help.--Rhonda
New Contributor
Posts: 2

Re: SAS/ACCESS connects to SQL server db, but I can't see tables.

Posted in reply to rho_tullis
I just discovered that my schema name should have contained the owner of the database. I can see tables now that I have the correct value for schema=.
Super User
Posts: 10,046

Re: SAS/ACCESS connects to SQL server db, but I can't see tables.

Posted in reply to rho_tullis
If you do not know schema, Then use the following code to find it.


[pre]
proc sql;
connect to odbc( dsn= user= password=);

create table schema as
select *
from connection to odbc(ODBC:Smiley Frustratedqltables)
;
quit;
[/pre]

Ksharp
Ask a Question
Discussion stats
  • 2 replies
  • 1338 views
  • 0 likes
  • 2 in conversation