Syntax issue with Update query
I am creating a Create Procedure that will be used to update a table with Update with Parameters query.
The problem I am having is with the syntax for some reason, it errors when I place a comma between two fields. If I put a comma like suppose it errors the rest of the statement. If I remove 1 comma between fields, then it errors on some of the fields with the = @Parametername. What am I missing? See Attached picture.
Any assistance you can offer is greatly appreciated.
CREATE PROCEDURE dbo.UpdateUsers
SET NOCOUNT ON;
[Name] = @FirstName
,[LastName] = @LastName
, [FullName] = @FullName
, [EMail] = @EMail
[UserRoles] = @UserRoles
[PostionType] = @PostionType
, [ManagerID] = @ManagerID
, [UUID] = @UUID
, [External_UUID] = @External_UUID
, [home_Location_id] =@home_Location_id
, [Home_Organization_ID] = @Home_Organization_ID
, [Home_Organization_Name] = @Home_Organization_Name
, [Record_types] =@Record_types
, [Location_Ceiling_ID] = @Location_Ceiling_ID
, [Location_Ceiling_Name] =@Location_Ceiling_Name
, [Organization_Ceiling_ID] =@Organization_Ceiling_ID
, [Payroll_Identifier] =@Payroll_Identifier
, [Created_Date] =@Created_Date
, [Update_Date] =@Update_Date
, [Audit_Date] =@Audit_Date
Where [User_ID] =@User_ID
Turns out if was a simple mistake I had in on the wrong database. when I placed it on the correct db it worked once I added the commas.