create procedure mathopera
(
@c int,
@e int,
@g int,
@i int
)
as
begin
set nocount on
select
(a+b) as c,
(@c-d) as e,
(@e*f) as g,
(@g/h) as i
from maths
end
if i entered the values all the operations have to be not performed .any mistake means correct it
Query is executed but operations are not sucess.
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Renish Patel160 reputationPosted May 31, 2013, 2:14 AM EDT
Can you please explain Maths table with field?
and for which purpose you have to used this store procedure?
Thanks
selvi subramanianRank #2,007 · 723 reputationPosted Jun 1, 2013, 1:32 AM EDT
Renish Patel160 reputationPosted Jun 1, 2013, 4:48 AM EDT
create procedure [dbo].[mathsoperation]
as
begin
DECLARE @a INT
SET @a=20;
DECLARE @b INT
SET @b=10;
SELECT
(@a+@b)AS Addition,
(@a-@b)AS Subtraction,
(@a*@b)AS Multiplication,
(@a/@b)AS Divison
end
It solves your problem..
If you getting your ans then please make this post as answered
Thanks
Happy Coding...
Renish Patel160 reputationPosted Jun 3, 2013, 3:37 AM EDT
Thanks
Renish