

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

insert into @roleactiontypes (name,guid) values('DeviceAddMultiple','154260C0-7EAE-4CA6-8D37-0BD9B687419D')



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.*;
