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

Hi - I have a script trying to connect to a MS-SQL Server.  It only connects to the first DATABASE out of the 3 available (below #1: SYSTEM DATABASES). 

  I need to connect to #3 Database(AMS) below.   Manually I can get on to the server so I have access to all 3.  Any ideas why I can't get to AMS Database?   Thank you.

 

libname db odbc

noprompt = "server=happp02vw\reporting;DRIVER=SQL Server Native Client 11.0;Trusted_Connection=yes"

DATABASE = AMS schema = dbo;

asabou01_0-1626349987010.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

Why is the icon different for AMS? Is it really a database?

Sajid01
Meteorite | Level 14

Please check if you have access to the database.
What is your environment?

asabou01
Obsidian | Level 7
This solution worked perfectly:
libname db odbc noprompt = "server=happp02vw\reporting;DRIVER=SQL Server Native Client 11.0;Trusted_Connection=yes;DATABASE=AMS" schema = dbo;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 431 views
  • 2 likes
  • 3 in conversation