How can I In the same script write a statement that demonstrates a call to this function as part of a "Select". Include ItemID, ItemPrice, DiscountAmount along with the function in this statement. The function is fnDiscountPrice
How to call a function as part of a Select statement
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Amit MohantyRank #112 · 20K reputationPosted Nov 10, 2022, 11:11 PM EST
Try this
Select ItemID, ItemPrice, DiscountAmount, dbo.fnDiscountPrice() as DiscountPrice From yourtablename.
Sachin SinghRank #66 · 26.2K reputationPosted Nov 11, 2022, 12:44 AM EST
you can even pass parameter as
select ItemPrice,DiscountAmount,dbo.fnDiscountPrice(ItemPrice)from tableName