我有一个执行 2 次更新的存储过程,但我只想在参数@active
等于时进行第一次更新'Y'
。
alter procedure sp_updateThis
@something varchar(5),
@active char(1)
as begin
-- check to see if active and do the update
update myTable set this=@something
-- run this one regardless
update yourTable set that=@something