表的有两个字段的内容是一样的。
字段名 类型
content clob
content1 long
要求在更新content的同时更新content1
添加的时候也一样
create tigger tt on yourtable
for insert,update
as
update content1=deleted.content
create tigger tt on yourtable
for insert,update
as
update t set content1=i.content
from 表 as t inner join inserted as i on t.key=i.key
建议你使用计算列
CREATE TABLE BaseTable
(
content long,
content1 as (content)
)
不过sqlserver没有clob类型的,另外两个字段的类型如果不一样的话,也应该可以自动转换才行。