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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3 replies
  • 867 views
  • 2 likes
  • 3 in conversation