|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Copy update like Copy insert?
Is there a way to do an update kind of the same way you would do the copy insert such as this:
Insert into yourtable Select ... from table..... I want to allow a client to set pricing to entire section but each seat in a venue is set as a seperate product. Thus allowing them to create a single price for a section requires a loop. The below code does not work of course but it gives you an idea as to what i would like to try and do. Can i accomplish this without a loop? update products set price = @iSeatAmt SELECT @iSeatAmt As price From products WHERE ((iCompanyFK = @iCompanyPk) AND (isBaseVenueSeat = 0) AND (cProductType = 'EventSeat')) AND (subcatcode = @subcatcode) AND (iTicketSectionFk = @iTicketSectionFk) |
|
#2
|
|||
|
|||
|
Do you mean you want to join on another table within the update? I'm not entirly clear what you want to do but perhaps this snippet of code might help?
update P set price = S.section_price from product P join section S on P.sectionID = S.sectionID where ((P.iCompanyFK = @iCompanyPk) AND (P.isBaseVenueSeat = 0) AND (P.cProductType = 'EventSeat')) AND (P.subcatcode = @subcatcode) AND (P.iTicketSectionFk = @iTicketSectionFk) |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Copy update like Copy insert? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|