July 9, 2008 at 2:19 am
When I try to ALTER the storproc I get the above error!
PLEASE HELP ME.
The problem is the adding of the two columns then updating the first one, which is the best way to do this?
ALTER PROCEDURE [dbo].[InsertMachineTestingA]
@MachModelID int,
@MachSerialNo nvarchar (50),
@MachCustomerID int = 1,
@MachComments nvarchar (100)= NULL
AS
INSERT INTO Machines (MachModelID, MachSerialNo, MachCustomerID, MachComments)
VALUES (@MachModelID, @MachSerialNo, @MachCustomerID, @MachComments)
UPDATE dbo.Parts
SET dbo.Parts.PartUnitsOnHand = sum(dbo.Parts.PartUnitsOnHand+dbo.ModelTemplates.ModTempPartUnits)
FROM dbo.Parts INNER JOIN dbo.ModelTemplates
ON dbo.Parts.PartID = dbo.ModelTemplates.ModTempPartID
WHERE (dbo.ModelTemplates.ModTempModelID = @MachModelID)
Thanks in advance
July 9, 2008 at 1:15 pm
Where is the above error?
November 17, 2010 at 8:43 am
You cannot have an aggregate in a set list of the update
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply