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 |
|
azwiefel
Starting Member
7 Posts |
Posted - 2003-09-01 : 15:14:36
|
Help, attached is a SP that I;m tring to get fuctioning... I'm sure the syntax is incorrect based on what I am reading...Basicly, I am tring to updated a table that is used as a reference table for a group of orders, each peice of equipment may have serveral "Counters" and the end number must be written back to this table after the order is closed out. CREATE PROCEDURE TEST (@equipmentID int,@transID BigINT,@modifiedBy int)ASUpdate dbo.equipment_CountersSET(counterStartCount,countermodifedBy,counterModifiedDate)VALUES (SELECT endCount, @modifiedby, Getdate()FROM dbo.TRANSACTIONS INNER JOIN dbo.TRANSACTIONS_EquipmentCounters ON dbo.TRANSACTIONS.transID =dbo.TRANSACTIONS_EquipmentCounters.transID AND dbo.TRANSACTIONS.siteID = dbo.TRANSACTIONS_EquipmentCounters.siteIDWHERE (dbo.TRANSACTIONS_EquipmentCounters.transID = @transID) AND (dbo.TRANSACTIONS.EquipmentID = @equipmentID))GOI would like to do this with minimum overhead and coding..Thanks for everyones help... |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-09-01 : 15:26:49
|
| update tblset col1 = t2.col1 ,col2 = t2.col2from tbljoin t2on ...join ...where ...==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|