T
tjlqp
Unregistered / Unconfirmed
GUEST, unregistred user!
/*将要修改表JXXH_GWPX的字段名称(@ZDM0)和要改为的新值(@ZDZ0 )及条件(@TJ0)做三个参数传给存储过程,想对将满足条件(@TJ0)表(@ZDM0)中数据的执行对(@ZDM0)字段的值改为新值(@ZDZ0 ),可无论如何都达不到目的。*/CREATE PROCEDURE UPDATE_GWPX @ZDM0 varchar(60),@ZDZ0 varchar(60) ,@TJ0 varchar(200) ASdeclare @zdm1 varchar(60),@zdZ1 varchar(60),@tj1 varchar(200)select @zdm1= @ZDM0select @zdz1= @ZDZ0select @tj1=@TJ0/*就是要达到下面SQL语句能达到的目的update jxxh_gwpx set xb='男' where id in (select id from jxxh_gwpx where xm ='张三')*/UPDATE jxxh_gwpx SET @zdm1 = @zdz1 WHERE CONVERT(varchar(5),id) in (@tj1)--上面这句既使执行,影响的记录也为零,问题可能出在(@tj1上。GO