

declare @RoleActionTypes table(
	[Name] [nvarchar](50) NOT NULL,
	[guid] [uniqueidentifier] NULL
)

insert into @roleactiontypes (name,guid) values('Activation','6F79F83F-29FB-49E2-8E34-76B6654C6366')



MERGE INTO [dbo].RoleActionTypes AS TARGET
USING @RoleActionTypes AS SOURCE
	ON TARGET.guid = SOURCE.guid
	WHEN MATCHED THEN    
			UPDATE SET name=source.name
	WHEN NOT MATCHED BY TARGET THEN   
			INSERT ( name,guid) VALUES (Source.name, SOURCE.guid)  
OUTPUT $action, SOURCE.*;
