
if object_id('tempdb..#usertblCrud', N'U') is not null
	drop table #usertblCrud
create table #usertblCrud(name nvarchar(128), is_exists bit, error nvarchar(max));

if object_id('tempdb..#usertblCR', N'U') is not null
	drop table #usertblCR
create table #usertblCR(name nvarchar(128), is_exists bit, error nvarchar(max));

insert into #usertblCR( name )
values ('Jura2')

create table ##newUser1(dbname nvarchar(128), name nvarchar(128), is_exists bit, error nvarchar(max));
insert into ##newUser1( dbname, name, is_exists, error) select 'D002', name, 0, null from #usertblCR union select 'D002', name, 0, null from #usertblCrud;

exec cfg.dbo.ncspCreateUserCLR '##newUser1';
--exec ncspCreateUserWrapExec '##newUser1';
update A set A.error = B.error 
from #usertblCR A 
	inner join ##newUser1  B on A.name = B.name;

select * from #usertblCR

select * from ##newUser1

drop table ##newUser1