Friday 15 June 2012

sql - stored procedure updating two tables with different id -


I have stored such functionality:

  change process [DBO] [Delivary] @DetateNaturalCourse (100), @CarriedNavarray (100), @ Transaction Integer as Transaction_Technicle T. Select transit IDID where T. BORCODE = @CareDD update TRANSCATION_TLL SET DelType = '' + + @DATATE + '', Status = 5 where TBarcode = @carid update KHanger_tbl set Delivered = 1 where transactid = @ transid end   

I am able to update my transaction table. I also want to update the table with KHanger_table with TransactID match @carid .

How can I do this?

should be

  change process [dbo] [Delivary] (@DatateNewCarcae (100), @CarridNavarrach (100)) starts as @tractID at; SET @ transactID = (Choose Transaction_tbl t from t.transactID where t.Tarcode = @carid); Transaction_tbl set DelDate = '' + @dedate + '', position = 5 where TBarcode = @carid update KHanger_tbl set Delivered = 1 where transactid = @ transactID end    

No comments:

Post a Comment