|
Home > Archive > Microsoft SQL Server forum > February 2006 > how to call a stored procedure in an insert command
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to call a stored procedure in an insert command
|
|
| satish 2006-02-25, 9:44 am |
| hi,
i had a small doubt , i have a table xxx with two columns (a int,b int
) and i have inserted 5 rows my query is to add the two colums using a
stored procedure and the result has to be displayed in an separate
column --this has to be done only stored procedures ---i know how to
solve the problem using computed columns concept
like this
create table yyy(a int ,b int ,total as a+b)
insert into yyy values (12,13)
select * from yyy
i need the answer using stored procedures---is it possible
pls help me
satish
| |
| Tony Rogerson 2006-02-25, 9:44 am |
| create proc get_your_calc
as
begin
select a, b, total = a + b
from yyy
end
--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"satish" <satishkumar.gourabathina@gmail.com> wrote in message
news:1140593950.858980.60120@g44g2000cwa.googlegroups.com...
> hi,
> i had a small doubt , i have a table xxx with two columns (a int,b int
> ) and i have inserted 5 rows my query is to add the two colums using a
> stored procedure and the result has to be displayed in an separate
> column --this has to be done only stored procedures ---i know how to
> solve the problem using computed columns concept
>
> like this
>
> create table yyy(a int ,b int ,total as a+b)
>
> insert into yyy values (12,13)
> select * from yyy
>
> i need the answer using stored procedures---is it possible
>
> pls help me
> satish
>
|
|
|
|
|