I have a table with the following data. I want to compare the value of column Expense to the value of column Budget. If column Expense > column Budget I want to execute additional code.
Any insight on the best way to do this would be greatly appreciated.
I am trying to develop a stored procedure in MS SQL Server 2000.
ID Description Budget Expense
0 Group Taxes & Fees NULL 100
1 Local 250 337.51
2 Long Distance NULL NULL
3 Data 239 238.51
4 Internet NULL NULL
5 Management NULL NULL
6 Maintenance NULL NULL
7 Integrated NULL NULL
8 Television NULL NULL
9 Conference Callings NULL NULL
10 Equipment NULL NULL
11 test NULL NULL
12 Cell Phone NULL NULL
13 SmartRing NULL NULL
So far I have:
SELECT * FROM table_1 WHERE (Expense>Budget)
I am unsure as to how to execute a procedure based on the values for each row besides using a user function. I need to perform an operation based on the Description, Expense and Budget values.
Thanks for the help.
Start Free Trial