Click here to Skip to main content
15,915,509 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
ALTER  FUNCTION dbo.getThisPVFooterAmount   ( @PVoucherHeaderId int ,@FooterAccountId int)
RETURNS money  AS
BEGIN

return (select Amount  from trans_PurchaseVoucherDetails with (nolock)
 where  PurchaseVoucherHeader_Id=@PVoucherHeaderId and  Record_Type ='F' And  Account_Id =@FooterAccountId  )
END

I have this function. how to create index on PurchaseVoucherHeader_Id,Record_Type,Account_Id ????
Posted
Updated 30-Jun-14 1:24am
v2

Hi,

Only functions that always return the same result for the same parameters—functions that are deterministic—can be indexed.
 
Share this answer
 
hi
SQL
CREATE INDEX index_name ON table_name (column_name)
 
Share this answer
 
Comments
rhl4569 28-Jun-14 1:39am    
thanks.. but this i know.. but how to use it in user defined function . that is my question?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900