April 9, 2007 at 2:02 am
Create Procedure SPPS
@Year1 int, @Year2 int ,@Year3 int ,@Year4 int ,@Subject1 int ,@Subject2 int, @Subject3 int, @Subject4 int
AS
BEGIN
declare @Money int
if exists (select Year, Subject from BarPieChart12 where Year=@Year1)
(
@Money = SELECT Subject from BarPieChart12 where Year=@Year1
@Subject1 = @Money + @Subject1
update BarPieChart12 set Subject1=@Subject1 where Year=@Year1
 
else
INSERT INTO BarPieChart12 (Year,Subject) VALUES(@Year1,@Subject1);
Plz it's URGENT
April 9, 2007 at 2:20 am
Create
Procedure SPPS
@Year1
int, @Year2 int ,@Year3 int ,@Year4 int ,@Subject1 int ,@Subject2 int, @Subject3 int, @Subject4 int
AS
BEGIN
declare @Money int;
if exists (select Year, Subject from BarPieChart12 where Year=@Year1)
BEGIN
SET @Money = (SELECT Subject from BarPieChart12 where Year=@Year1);
SET @Subject1 = @Money + @Subject1;
update BarPieChart12 set Subject1=@Subject1 where Year=@Year1;
END;
ELSE
BEGIN
INSERT INTO BarPieChart12 (Year,Subject) VALUES(@Year1,@Subject1);
END;
END
;
April 10, 2007 at 12:41 am
I m very happy.
Thanx
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply