I have the following:
select top 1
Loan_Num,
Due_date = (Select due_date from dbo.fnc_FetchSingleLoanInfo(Loan_num, add_date))
from
tblComments
order by
Add_date desc
Where definition of fnc_FetchSingleLoanInfo:
ALTER Function dbo.fnc_FetchSingleLoanInfo
(
@charLoanNum as char(10),
@dteSnapDate as datetime
)
RETURNS TABLE
as
RETURN
Select TOP 1 * FROM tblKeyLoanChanges
Where
Record_Date <=@dteSnapDate
AND
Loan_Num = @charLoanNum
Order by Record_Date desc
I'm recieving the following error:
Server: Msg 155, Level 15, State 1, Line 3
'Loan_num' is not a recognized OPTIMIZER LOCK HINTS option.
I know I can normally pass columns into a function and return a value... can I not do this when it returns a table? I'm not sure what the problem is here.
Thanks for the help!
Randall Vollen
National City Bank Corp.
select top 1
Loan_Num,
Due_date = (Select due_date from dbo.fnc_FetchSingleLoanInfo(Loan_num, add_date))
from
tblComments
order by
Add_date desc
Where definition of fnc_FetchSingleLoanInfo:
ALTER Function dbo.fnc_FetchSingleLoanInfo
(
@charLoanNum as char(10),
@dteSnapDate as datetime
)
RETURNS TABLE
as
RETURN
Select TOP 1 * FROM tblKeyLoanChanges
Where
Record_Date <=@dteSnapDate
AND
Loan_Num = @charLoanNum
Order by Record_Date desc
I'm recieving the following error:
Server: Msg 155, Level 15, State 1, Line 3
'Loan_num' is not a recognized OPTIMIZER LOCK HINTS option.
I know I can normally pass columns into a function and return a value... can I not do this when it returns a table? I'm not sure what the problem is here.
Thanks for the help!
Randall Vollen
National City Bank Corp.