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

Good morning,

 

I assume the answer is 'no', but has anyone found a way to run a SQL Server proc from SAS? 

 

Thanks!

 

--Ben

1 ACCEPTED SOLUTION

Accepted Solutions
r_behata
Barite | Level 11

here is the syntax :

 

PROC SQL;
	Connect to odbc (datasrc=datasrcnm user = user_id password = pwd);
		Execute(db.stored_proc) by odbc;
	Disconnect from odbc;
QUIT;

View solution in original post

5 REPLIES 5
r_behata
Barite | Level 11

The Execute statement can be used to run the SQL Server Stored process from SAS.

 

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473677.htm

 

 

r_behata
Barite | Level 11

here is the syntax :

 

PROC SQL;
	Connect to odbc (datasrc=datasrcnm user = user_id password = pwd);
		Execute(db.stored_proc) by odbc;
	Disconnect from odbc;
QUIT;
BenConner
Pyrite | Level 9

Well isn't that slick.  🙂  And it even works with ODBC.

Thanks very much!

 

--Ben

Reeza
Super User
SQL Pass through - any code you pass over to the server will work, as long as you have the correct permissions.
BenConner
Pyrite | Level 9

Someday I hope to convince them to get Access for SQL Server.  Until then... sigh.

 

--Ben

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 5 replies
  • 1625 views
  • 7 likes
  • 3 in conversation