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

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -