how I update serval records with connection.execSql(request)

66 views
Skip to first unread message

Zhang J

unread,
Aug 4, 2017, 5:26:15 AM8/4/17
to tedious
I have accepted serval data records from web page,and want to use teidous to update database
how I use execSql(request) to complete my job,because one connection only can exec one request.
and how I can set serval sql string to one request?


anyone can help me? thank you so much!!

Tito

unread,
Aug 8, 2017, 12:42:55 PM8/8/17
to tedious
I send my data as xml string. on the server end my stored procedure will then convert this string to actual xml and then ingest as follows. 


declare @virtslist xml
select @virtslist = @assignedvirts;

create table #updateowner(vmid bigint not null, vmselected bit not null, vmowner nvarchar(300) not null)

insert into #updateowner                       
select x.v.value('vid[1]', 'int') as vmid,
      x.v.value('vs[1]', 'bit') as vmselected,
  x.v.value('vo[1]', ' nvarchar(300)') as vmowner
 from @virtslist.nodes('/v/v') x(v)
  where x.v.value('vs[1]', 'bit') = 1;

not sure if this can work for you.
Reply all
Reply to author
Forward
0 new messages