你的数据随意性还是比较大的:
create trigger trg_update_tbl on tbl
for update
as
begin
if update(职位)
update a set a.项目经理=b.姓名 from tbl a join inserted on a.部门=b.部门 and a.职位='程序员' and b.职位='项目经理'
create trigger trg_update_tbl on tbl
for update
as
begin
if update(职位)
update a set a.项目经理=b.姓名 from tbl a join inserted on a.部门=b.部门 and a.职位='程序员' and b.职位='项目经理'
解决方案 »
- 如何返回Select语句的第一条记录给变量?
- 关于字段类型问题,存入太多数据出错
- 求救呀!! 从不同表中做统计的 SQL语句.超难!(对于我来说)
- <急急急急急急> 写出存储过程和触发器
- 字符串连接函数的BUG?怎么按时间先后累加呀.
- 怎样实现如下功能?
- 如何把下列内容格式的文本文件转换为DBF文件或其他格式数据库文件?
- verchar转int型的时候出现小问题,请达人帮忙看看
- left join选择唯一记录问题
- 有关schema.ini中日期格式的问题
- 如何判断当前的数据库是sql server7.0还是sql server2000?
- 连接远程SQL2000数据库服务器的问题??????????
for update
as
begin
if update(职位)
update a set a.项目经理=b.姓名 from tbl a join inserted on a.部门=b.部门 and a.职位='程序员' and b.职位='项目经理'
end