摘要: CREATE TRIGGER tg_nameON TableNameFOR INSERT,UPDATE,DELETE /*一种或多种*/ASdeclare... ;select ... from deleted; /*取得更新之前数据*/select... from inserted;/*取得更新之后数据*/if update(field name) /*针对具体列*/ begin ..... end 阅读全文
posted @ 2011-11-08 13:44 Yu 阅读(97) 评论(0) 推荐(0) 编辑
摘要: ALTER function [dbo].[GetOwnerString](@Id int)returns nvarchar(200)asbegindeclare @result nvarchar(200),@owner nvarchar(20);set @result='';declare owner_cursor cursor for select Owner from InProcess where ProjectId=@Id;open owner_cursor;fetch next from owner_cursor into @owner;while(@@FETCH_ 阅读全文
posted @ 2011-11-08 11:07 Yu 阅读(168) 评论(0) 推荐(0) 编辑