SQL觸發如何實現這樣的效果

2022-09-18 18:05:22 字數 598 閱讀 8060

1樓:匿名使用者

if (object_id('tgr_classes_update_column', 'tr') is not null)

drop trigger tgr_classes_update_column

gocreate trigger tgr_classes_update_column

on student

for update

as--列級觸發器:是否更新了student的id欄位

if (update(id))

begin

update  score set id=** where ...--修改score表的id=**

rollback tran;

endgo

2樓:小張風風

用觸發器,網上搜一下觸發器用法

3樓:一顆程式猿

你這個sqlserver還是oracle還是mysql的?

4樓:匿名使用者

兩種方式

1、觸發器

2、儲存過程

個人感覺儲存過程好一些

這樣的網頁效果是怎麼實現的

在http www.thehorizontalway.com 網頁,點選 檢視 v 原始檔 c 則開啟原始檔 視窗,你可以看到編碼 程式語言 中的有關 go right go left 即向右 向左 的語言 去學吧,大膽嘗試 10來分鐘你就會。如下圖 很簡單,eg 用a標籤包裹img,當滑鼠懸浮在 ...

如何實現MyBatis僅更新SQL語句中指定的欄位

update tab1 set name replace name,abc d where name like abc 如何實現mybatis僅更新sql語句中指定的欄位 物件 public class entity 資料 表 create table qai entity id char 10 n...

如何實現MyBatis僅更新SQL語句中指定的欄位

物件 資料 zhi表 dao回 create table qai entity id char 10 not null,value int not null default 0,create time timestamp not null,primary key id mybatis 配置答 如何實...