﻿ALTER PROCEDURE [dbo].[sp_GroupsUpdate]
	@Id					INT,
	@SerialNumber       NVARCHAR (255),
	@Picture			NVARCHAR (255) = NULL,
	@DisplayName		NVARCHAR (255),
	@Description		NVARCHAR (255),
	@Embedded			BIT,
	@LastModified		DATETIME,
	@LastModifiedBy		NVARCHAR (255),
	@StaticGroupId		INT = NULL,
	@ExtraProperties	NVARCHAR (MAX),
	@errorNumber		INT OUTPUT,
	@errorMessage		NVARCHAR (255) OUTPUT
AS
BEGIN
	SET NOCOUNT ON;
	SET @errorNumber=0
	SET @errorMessage=''
	
	UPDATE [dbo].[Groups] SET [SerialNumber]=@SerialNumber, [Picture]=@Picture, [DisplayName]=@DisplayName, [LastModified]=@LastModified, [LastModifiedBy]=@LastModifiedBy, [Embedded]=@Embedded, [Description]=@Description, [StaticGroupId]=@StaticGroupId, [ExtraProperties]=@ExtraProperties WHERE [Id]=@Id

	if(@@error != 0)
	begin
		set @errorNumber = error_number()
		set @errorMessage = error_message()
	end
END