Is it possible to call a stored proc from excel and pass through a paramter?
If it is would anyone have a clue how to do this?
Is it possible to call a stored proc from excel and pass through a paramter?
If it is would anyone have a clue how to do this?
A bit more detail of what you are trying to acheive will result in a better answer
Please Read Forum Rules Before Posting
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post politely
Top Excel links for beginners to Experts
If you are pleased with a member's answer then use the Scales icon to rate it
If my reply has assisted or failed to assist you I welcome your Feedback.
i have built a simple query on sql server which requires a date. I would like to call this stored proc from excel and pass the dat and return the data into a worksheet.
hope this helps
My example:
"Exec Forms_2_4_Log ""4"" ,""2007-01-01"",""2007-05-03""")-Please Login or Register to view this content.
is the Stored Proc Call
Many thanks for your response.
"Exec Forms_2_4_Log ""4"" ,""2007-01-01"",""2007-05-03"""
How is this broken down?
Im assuming that Forms_2_4_Log is the name of the stored proc, what is the 4? and im assuming that the dates act as from and to date parameters?
My Stored Proc has 3 parameters.
"4" is one of them.
You need only the 2-nd and the 3-d ones.
How does the below know which parameter, which value is being passed in to? All i can see is values but no paremeter references?
I suppose you have created a stored procedure in
SQL Server or alike.
If not, tell what database you use .
im using sql server enterprise manager
Here is the Procedure I've created in Enterprize Manager.
You could see above calling this procedure.Please Login or Register to view this content.
Just remove "4" from what i wrote.
Replace this code by yours.
@DateFrom and @DateTo are the parameters.
Naming is free.
Firstly thabnk you for your help.
Im good with setting up the stored proc i just wasnt sure how the stored proc would now which date was for which parameter but im assuming that the first value provided will automatically be picked up by the first parameter and so on.
You dont have to define in excel @DateFrom = 'date' and @dateto = 'date'
Your conclusion is correct.
Good luck in our hard work!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks