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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 823 views
  • 7 likes
  • 3 in conversation