我SqlServerFunctions
在 test.cs 文件中有一个项目。代码:
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlDecimal CalculateBondDV0N(SqlDecimal coupon, SqlDecimal yield, SqlDateTime date)
{
DayCount dayCount = (DayCount)Enum.Parse(typeof(DayCount), dayCountString.ToString(), true);
Frequency frequency = (Frequency)Enum.Parse(typeof(Frequency), frequencyString.ToString(), true);
double price = BondAnalyticsUtility.CalculateDV0N((double)coupon.Value, dayCount, frequency, (double)yield.Value, date.Value, finalPaymentDate.Value, (double)redemptionValue.Value, (double)notional.Value, (double)spreadChange.Value);
SqlDecimal returnVal = new SqlDecimal(price);
return returnVal;
}
这个函数通过给定EXTERNAL
参数从 Scalar 值函数内部的 Sql Server 调用。
ALTER FUNCTION [dbo].[CalculateBondDV0N](@Coupon [decimal](18, 6), @Yield [decimal](18, 6), @Date [datetime])
RETURNS [decimal](18, 7) WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [Pearl.Analytics.Services.Database].[BondAnalytics].[CalculateBondDV0N]
我想调试这个函数,代码在 c# 中,试图调试到 VS2010 pro 我如何将它与数据库连接并做到这一点。?