CREATE FUNCTION [dbo].[Percentage]
(
@Percentage DECIMAL(4,2) ,
@ColumnNameValue DECIMAL(7,2)
)
RETURNS DECIMAL(7,2)
BEGIN
DECLARE
@Output DECIMAL(7,2)
SET @Output = (@Percentage/100)*@ColumnNameValue
RETURN
@Output
END
select Percentage(10,1000)
output : 100
No comments:
Post a Comment