存储过程可以实现.
我想楼主应该是想先查询,然后更新吧。
create procedure search
@id int,
@falgvalue int
as
select * from tb1 where id=@id
update tb1 set flag=@falgvalue where id=@id
create proc find
@id int,--假设这里是查询的条件,当然最好是主键
@content varchar(50) --要更新的结果
as
select * from table_name where 主键=@id
update table_name set flag=@content where 主键=@id
用视图肯定不行啊
这样做吧
CREATE proc sp_Update
@XTBH int,@flag varchar(10)
as
update A set flag=@flag where XTBH=@XTBH
select * from A where XTBH=@XTBH
go
exec sp_Update