asp.net - SQL - Stored Proc to Update table from Table Variable -



asp.net - SQL - Stored Proc to Update table from Table Variable -

i have stored procedure inserts records table using values table variable. (the table variable sent sql asp.net) works perfect , looks this...

create procedure sp_saveresponses ( @tablevariable saveresponsestabletype readonly ) begin insert tbl_responses ( assessmentid, questionid, answerid ) select assessmentid, questionid, answerid @tablevariable end

the above inserts 1 record tbl_responses every row in @tablevariable.

the problem instead of insert, perform update, can't syntax right.

thanks help...!

update helpful hints, able resolve below...

you seek (i haven't tested it) -

create procedure sp_saveresponses ( @tablevariable saveresponsestabletype readonly ) begin update tbl_responses set questionid = @tablevariable.questionid @tablevariable @tablevariable.assessmentid = tbl_response.assessmentid end

asp.net sql

Comments

Popular posts from this blog

c# - Move local mssql database to webhosted MYSQL -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

java - How to pass parameters between Request-Scoped Controllers? -