An aggregate may not appearin the set list of an UPDATE statement

  • When I try to ALTER the storproc I get the above error!

    PLEASE HELP ME

    ALTER PROCEDURE [dbo].[InsertMachineTestingA]

    @MachModelID int,

    @MachSerialNo nvarchar (50),

    @MachCustomerID int = 1,

    @MachComments nvarchar (max)= NULL

    AS

    INSERT INTO Machines (MachModelID, MachSerialNo, MachCustomerID, MachComments)

    VALUES (@MachModelID, @MachSerialNo, @MachCustomerID, @MachComments)

    UPDATE dbo.Parts

    SET dbo.Parts.PartUnitsOnHand = 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

  • The BLOB datatypes that are specified with "max" are available only on SQL Server 2005 and later. You are trying to use nvarchar(max) and the "max" part confuses the 2000 database, as it is not supporting these types.

    You will need to use another data type, or move to 2005 or later.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply