SQLServer2000中,触发器到底是否能建在视图上吗?谢谢
我写了一个触发器,内容如下,可就是报错
题目原意是:创建一个名为UpdStartDt的触发器,它将反映任何在cruise_book表和customer表中的开始日期的更改。
题目对大家来说不是很难,小弟刚刚接触SQLServer,不明之处,望各位高手赐教。
-- Create trigger 'UpdStartDt'
create view cruise_book_customer
as
select cruise_book.cruise_cd as cruise_book_code,
cruise_book.start_dt as cruise_book_start_date,
customer.start_dt as customer_start_date
from cruise_book, customer
where cruise_book.cruise_cd = customer.cruise_cd
go
create trigger UpdStartDt
on cruise_book_customer
for update
as
begin
if update(cruise_book_start_date)
print 'Start_date of cruise_book has modified!'
if update(customer_start_date)
print 'Start_date of customer has modified!'
end
go