Link to home
Start Free TrialLog in
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.
ASKER CERTIFIED SOLUTION
Avatar of _TAD_
_TAD_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DataQuery
DataQuery

ASKER

Interesting take.
Thanks, will pass it on.