1. Create store procedure Sp_Simple_Calculator
CREATE PROCEDURE Sp_Simple_Calculator
@Num1 decimal,
@Num2 decimal
AS
BEGIN
SELECT @@ServerName as ServerName,db_name() as [DBName],getdate() [Date],'Result @Num1 & @Num2' as Desctiption,@Num1 as [Num1],@Num2 as [Num2], @Num1 + @Num2 AS 'Result Additional',
@Num1 - @Num2 AS 'Result Substraction',@Num1 * @Num2 AS 'Result Multiplication',@Num1 / @Num2 AS 'Result Division';
END
2. test execute ( example Numb 1=100, Numb 2=20
No comments:
Post a Comment