Owais Ahmed Owais Ahmed - 1 month ago 7
SQL Question

Sql stored procedure to update empty column

This is my table

FundId Fund Industry State Column1
1 1 2 NSW
2 1 2 ACT
3 1 2 VIC
4 1 2 NSW
5 1 2 ACT
6 1 2 VIC
7 1 2 NSW
8 1 2 ACT
9 1 2 VIC


Currently the Column1 is empty which is a calculated column. It is calculated as

Column1: fund*5


Below is the query to calculate Column1

SELECT Fund,
Industry,
State,
Fund * 5 AS Column1
FROM fundDetails


The query is working fine. But i want to updated the empty Column1 using stored procedure.

How can I update the
column1
.

Any help would be appreciated.

Answer
CREATE PROCEDURE USP_Upd_fundDetails
AS
BEGIN
      UPDATE fundDetails
      SET Column1 = Fund*5
END
Comments