0

I need to be able to specify the schema that I want to access in SAS. I have used a connection string with the following schema=?? but SAS will not let me select or print the contents of any object in the named schema. Has anyone been able to write a PROC SQL statement selecting objects in a schema other than dbo?

Thank you,

2
  • For some connection options the schema is case sensative. Check that first.
    – RWill
    Aug 31, 2011 at 22:54
  • It may be persisting permissions too. Also, try using pass-through to confirm you can do what you're wanting to do.
    – sasfrog
    Sep 1, 2011 at 0:09

1 Answer 1

2

SAS does not use fully quallified names from the SQL server but you can direct SAS to a specific schema. The following is an example that uses a libname as connection to a 2008 SQL Server.

proc print data=myDBconn.v_Lots (SCHEMA=SAS);
   WHERE Study_ID IS NOT NULL;
run;

proc print data=myDBconn.Drugs (SCHEMA=Pharmacy);
   where _drug_id=1;
run;

proc sql;
   create table myTest.drugs as ;
   (SELECT * FROM myDbconn.drugs (SCHEMA=Pharmacy));
quit;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.