Avatar of DataQuery
DataQuery
 asked on

Accessing SQL Server function passing parameters

Hi

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.

Thanks.
Microsoft SharePoint

Avatar of undefined
Last Comment
DataQuery

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
_TAD_

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
DataQuery

ASKER
Interesting take.
Thanks, will pass it on.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23