|
You can't use Excel functions directly in TSQL, at least not in any reasonable fashion.
In theory, you might be able to invoke an instance of Excel with object automation, set up a worksheet with the function, populate it with data, retrieve the result and return that from a stored procedure. But I doubt any sane DBA would let you put that mess on a production server. What if there are multiple calls to this function, how many Excel processes do you want to have on your SQL Server at one time?
You could create a spreadsheet in Excel that loads data from SQL Server, and stores the results back to SQL Server. The Excel process is on the client where it should be.
The best solution (for running in SQL Server) would be to find a definition for the algorithm behind the YIELD function and code it in T-SQL, or in a CLR function.
|