BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mcook
Quartz | Level 8

I am connecting to SSMS via ODBC using the following code

libname mylib odbc noprompt = "driver = ODBC Driver 11 for SQL Server;
                             server = Server_Name;
                             database = Database_Name;
                             Trusted_Connection = yes"
                 schema = Schema1;

If i'm only interested in the tables in schema1, schema2 and schema3,

is it possible to get all 3 schemas into one library?  or am i limited to having an individual library for each schema?  

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

You can create  a compound library.

libname LIB1 odbc ... schema = Schema1;
libname LIB2 odbc ... schema = Schema2;
libname LIB3 odbc ... schema = Schema3;
libname LIB4 (LIB1 LIB2 LIB3);

 

View solution in original post

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

You can create  a compound library.

libname LIB1 odbc ... schema = Schema1;
libname LIB2 odbc ... schema = Schema2;
libname LIB3 odbc ... schema = Schema3;
libname LIB4 (LIB1 LIB2 LIB3);

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 825 views
  • 2 likes
  • 2 in conversation