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 |
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2003-09-08 : 17:56:53
|
| For some odd reason I have never come across this before I dont think. Due to the database designs I have been working with being fairly simple.I am trying to do an update statement, but one of the WHERE clauses requires a join. Here is what I have so farAny help is greatly appreciated.Thanks alotMike123CREATE PROCEDURE [update_tblProducts_1] ( @productID [int], @userID [int], @description [varchar], @cost [money], @durationDays [smallint] )AS SET NOCOUNT ONUPDATE [tblProducts] 'not sure about this lineJOIN tblZones on tblZones.zoneID = tblProducts.zoneIDSET [description] = @description, [cost] = @cost, [durationDays] = @durationDays WHERE ( [tblZones.userID] = @userID AND [productID] = @productID )GO |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-09-08 : 17:59:23
|
| [code]UPDATE tblProductsSET [description] = @description,cost = @cost,durationDays = @durationDays FROM tblProducts pJOIN tblZones z on p.zoneID = z.zoneIDWHERE z.userID = @userID AND [productID] = @productIDGO[/code]Tara |
 |
|
|
mike123
Master Smack Fu Yak Hacker
1462 Posts |
Posted - 2003-09-08 : 18:16:16
|
| thank you |
 |
|
|
|
|
|