sql - Run a foreach loop on returned results in a stored procedure. -
I have a stored procedure that returns results from Table 1, then I stored another to update that table I use the procedure. I was wondering if I can add it to a stored procedure, the problem is that it will be necessary to update all prices to run a foreach loop on table 2, based on price from table 1 . Where is the idea to start or it is also possible
This is something to run for each item Example but you should not need it for updates, you should be able to solve it with cross join, anyway as follows.
declare @i int; Set @i = 0; Select the @t table (enter id id, manipulation (maximum) col1, varchar (max) col2, in @t (col1, col2), select col1, from col2 to fir [table] set i = 0; declared @sum int Set @sum = 0; while (i choose
Comments
Post a Comment