Accessing SQL Server function passing parameters


I'm wondering how standard it is to create a chart in SharePoint (perhaps via Excel services) that queries the data from a SQL Server user defined function (while passing parameters to said function).

From SSMS, it's as simple as
SELECT * FROM dbo.FunctionName(12345, '2015-01-01', '2016-01-01')
or, parameterised, something like:
SELECT * FROM dbo.FunctionName(@Param1, @Param2, @Param3)

The parameters need to be passed to the server request (either as dedicated parameters, or resolved into the SQL string and then passed).  Does this require some .NET extention on the SharePoint side or is it standard?
From Excel, you'd be able to set up an OLE connection, with a standard command text something like:
SELECT * FROM dbo.FunctionName(@Param1, @Param2, @Param3)
and pass the parameters from the spreadsheet at runtime.

Any input most welcome.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is this an onsite SharePoint installation, or is it a hosted O365 instance?  It makes a difference.

The easiest and most straight forward way to do this is to

{step 1} forget about SharePoint and build the solution in Excel using OLAP or oData connections within Excel.  

Then {step 2} Once you have a working solution which queries the database and grabs the results (all within excel), you can then host the Excel document within SharePoint and use Excel Services and Excel Web Access Web Part to interactively display pages/tabs of the Excel document.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DataQueryAuthor Commented:
Interesting take.
Thanks, will pass it on.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.