Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
abarsami
Yak Posting Veteran
68 Posts |
Posted - 2001-06-13 : 17:46:34
|
| This store procedure inserts one row only ... the last row into X.I need it to loop through Table A and insert all the rows into X.Can someone help.. or post the code with mine to make it loop.Thankscreate Procedure dbo.usp_Ins_REBASset nocount ondeclare @mgi_name varchar(80)declare @mgi_code varchar(20)declare @hotel_code varchar(20)declare @adj_day_d datetimedeclare @day_reb_amt moneyselect @hotel_code = hotel_code ,@adj_day_d = adj_day_d ,@mgi_name = mgi_name ,@day_reb_amt = day_reb_amtFrom TableAif (@mgi_name = 'GROUP') select @mgi_code = 'G'if (@mgi_name = 'TRANSIENT') select @mgi_code = 'T'if (@mgi_name = 'OTHER') select @mgi_code = 'O'Insert Into X ( hotel_code ,mgi_code ,adj_day_d ,adj_day_adj_final_amt )Values ( @hotel_code ,@mgi_code ,@adj_day_d ,@day_reb_amt) |
|
|
|
|
|