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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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